34 questions from the last 30 days
12
votes
1
answer
703
views
How can I set up Thread-Local Storage (TLS) callbacks on Windows without CRT?
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 ...
2
votes
2
answers
165
views
Java Thread interrupt non deterministic behaviour
I have this piece of code in Java and I tried it out on Java 21 (Eclipse Temurin and GraalVM)
public static void main(String[] args) {
Thread.currentThread().interrupt();
long start = ...
6
votes
1
answer
336
views
Is it possible to build a mutex from C++20 std::atomic without spinning to avoid use-after-free when deleting?
Before I get to my main question, I'm assuming that std::mutex::unlock() stops touching this as soon as it puts the mutex in a state where another thread might lock it - even though the call to unlock(...
2
votes
2
answers
191
views
Is it possible/how to let parent class thread invoke function in child class that overrides parent function?
I am trying to implement a Parent and Child class. The Parent class would start a thread and run a routine function. The Child class would override the routine function if needed.This seems perfectly ...
4
votes
1
answer
96
views
Java ExecutorService detect asap thread fail
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 ...
5
votes
0
answers
229
views
Why does this data race have some consistent invariants with writers updating one of three atomic<int> variables?
I have the following program. The relevant info is:
There are 3 variables atomic<int> x,y,z accessed by all threads.
3 writer threads: Each thread read all 3 values x,y,z, and update exactly 1 ...
0
votes
1
answer
315
views
Can external IO operations be considered as if seq_cst operations in the reasoning of multithreaded programs?
Consider this example:
// thread A:
start_transaction();
update_mysql();
commit_transaction(); // remove "key" from mysql tables
remove_redis_cache("key");
// thread B:
std::...
0
votes
1
answer
86
views
Python gets stuck in an infinite loop restarting multiprocessing pool workers on error in initilization routine
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 ...
1
vote
0
answers
111
views
How is a non-parallelized for loop inside an OpenMP parallel section executed?
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++)
{
...
}
}
...
0
votes
2
answers
68
views
Threading in Rust with mutable objects
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 ...
0
votes
2
answers
59
views
Calculate byte positions to split ndjson files into chunks
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 ...
-6
votes
0
answers
73
views
Undesired Pulsating in Rendering and Cumulative Slowdown When Implementing Fixed Physics Timestep in Multithreaded Physics [closed]
INTRO
I am getting unwanted pulsing and slowing down in rendering 2d particles, which should be drawn faintly (low alpha) and leave a fading trail under the influence of gravity. Below is a ...
0
votes
1
answer
77
views
Pyspark- Multithreading in Python
I have a user case like this. I have a list of many queries. I am running multi-threading with pyspark with each thread submitting some sql.
There are some queries that report success but the final ...
2
votes
1
answer
63
views
Opening a pop-up window when error from a worker running in Qthread occurs completely freezes the program
I was trying to create a little Python program with a GUI using Pyside6. I ran into a problem when creating a thread for a worker to do a task (check files with a certain condition and then copy them ...
1
vote
0
answers
68
views
How To Create Progress Into Thread In UEFI For Multitasking [closed]
UEFI By Default Starts OS With Single Core And Is Harder To Multitask In UEFI Using Start Progress In Thread. I am making OS Form Scratch For Multitasking But There Is No Option To Multitask In EDK 2 ...
0
votes
0
answers
43
views
How to set up multi-thread logging to different loggers using QueueListener and QueueHandler
I have a Python application that runs multiple tasks in parallel using ThreadPoolExecutor. I want all threads to log safely without race conditions. I also need two loggers:
Console logger (prints ...
0
votes
0
answers
17
views
Actix-web + Tokio: Server hangs when using tokio::spawn with Arc<Mutex> loop
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 ...