Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
70 views

I'm quite new to rust and want to do two function in parallel. shoot(&fleet_a, &mut fleet_b) shoot(&fleet_b, &mut fleet_a) since they only take information from one and modify some ...
basicn00b's user avatar
0 votes
0 answers
19 views

I am facing an issue where my Actix-web server starts correctly, but the moment I hit the /upload_chunk endpoint from my frontend, the request hangs forever. After some debugging, I found that the ...
forstudy's user avatar
1 vote
0 answers
111 views

Consider the following code: #pragma omp parallel for (int run = 0; run < 10; run++) { std::vector<int> out; #pragma omp for for (int i = 0; i < 1'000'000; i++) { ... } } ...
F.X.'s user avatar
  • 7,475
5 votes
2 answers
180 views

In the released .NET 10 there is a new method added to the Volatile class with the name ReadBarrier(). And I don't know whether from the compilers perspective there is a difference if I do a read with ...
Dominik Ferencz's user avatar
0 votes
1 answer
41 views

I am trying to display the stack traces of RTOS fibers running in a C++ solution in VS2022. Since upgrading to Windows 11 there seems to be a problem in the implementation. The existing approach, ...
Sparky_335's user avatar
1 vote
1 answer
127 views

My code should print the numbers given as command line arguments. Instead it prints random-looking values. What is going on and how can I fix it? #include <stdio.h> #include <pthread.h> #...
user31884282's user avatar
4 votes
1 answer
97 views

I have to run x asynchronous threads , which can last several minutes each. They ALL have to terminate properly without exceptions. If one fails I have to stop them all immediately and not wait ...
MaxSan's user avatar
  • 51
1 vote
1 answer
193 views

I have a bounded queue with small size that definitely fit in int. So I want to use atomic<int> instead of atomic<size_t> for indexing/counter, since int is smaller it should be faster. ...
Huy Le's user avatar
  • 1,979
0 votes
0 answers
106 views

I’m currently studying Operating Systems at college, and my professor has started teaching us about threads and pipes in C. His teaching style is very practical — he expects us not only to understand ...
Matheus Ferreira's user avatar
0 votes
1 answer
315 views

Consider this example: // thread A: start_transaction(); update_mysql(); commit_transaction(); // remove "key" from mysql tables remove_redis_cache("key"); // thread B: std::...
xmh0511's user avatar
  • 7,618
12 votes
1 answer
704 views

I'm trying to register a Thread-Local Storage (TLS) callback in a Windows application without using the C runtime (CRT). Compiler: MSVC 14.44.35207 (Visual Studio 2022) Target: x64 OS: Windows 11 I ...
felix's user avatar
  • 131
2 votes
1 answer
44 views

I do have the following line in my Android app: private Logger logger = LoggerFactory.getLogger(getClass().getSimpleName()); When testing for threads access in strict mode i found the following issue ...
4ntoine's user avatar
  • 20.6k
0 votes
2 answers
59 views

Below is the code extracted from this repo: import os.path, io filename = "" n_chunks = 12 # Number of processes to use -- will split the file up into this many pieces def ...
Akira's user avatar
  • 2,808
-1 votes
0 answers
137 views

I'm trying to write an audio player in Java/JavaFX and want to make a playlist play songs automatically. I have a button that triggers a new thread, and everything works fine so far.. but when the ...
Momo Tamura's user avatar
0 votes
1 answer
86 views

I am trying to setup a multiprocessing Python task on Windows 10, Python 3.13. I have "main.py" module, containing the main entry, "orchestration.py" module with worker ...
PChemGuy's user avatar
  • 1,859
0 votes
1 answer
162 views

[intro.execution] p8 says: Given any two evaluations A and B, if A is sequenced before B (or, equivalently, B is sequenced after A), then the execution of A shall precede the execution of B. ...
xmh0511's user avatar
  • 7,618
3 votes
2 answers
163 views

I'm reading this: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3292r0.html Here's code sample the question is about: int dummy; std::atomic<int *> ptr_to_int_1{&dummy}; std::...
De Cay's user avatar
  • 34
0 votes
1 answer
64 views

This question stems from a technical interview where I was asking candidate about multithreading, and the differences between "true multithreading" via multiple hardware cores and/or ...
Dominik Kaszewski's user avatar
4 votes
1 answer
105 views

The following program assumes that /path/to/mypipe is a named pipe, e.g. created via mkfifo /path/to/mypipe, with no readers/writers waiting yet, runs two threads, of which the main thread keeps ...
Enlico's user avatar
  • 30.2k
0 votes
0 answers
153 views

I have a single board computer with a I2C GPIO expander device, listed as /dev/i2c-0. In my multithreaded program I open() this character device and read/write to it on separate threads using ...
j-hc's user avatar
  • 515
0 votes
0 answers
404 views

Python has officially introduce Python install manager and free-threading feature in 3.14, but I cannot find out how to enable free-threading feature with Python install manager. Is there a way to ...
Feifan Wang's user avatar
0 votes
0 answers
127 views

I've written a MQTT client for embedded system with RTOS (understand not POSIX, generally FreeRTOS). There's no pthread in the system. There's only 32 bits atomic instructions supported. The client ...
xryl669's user avatar
  • 3,682
2064 votes
35 answers
1.4m views

What is the technical difference between a process and a thread? I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes ...
James Fassett's user avatar
7 votes
1 answer
106 views

In Rust Atomics and Locks chapter 5 (available online for free), this example implementation of a one-time channel is presented: pub struct Channel<T> { pub message: UnsafeCell<...
tux3's user avatar
  • 7,431
8 votes
1 answer
252 views

In the following program, I want to print the output as 0102030405... so on The 0 should be printed from one thread, odd values should be printed from second thread and even values from third thread....
SandeshK3112's user avatar

1
2 3 4 5
2822