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

#include <atomic> #include <thread> #include <cassert> #include <chrono> std::atomic<int> x {}, y {}; void write_x_and_y() { x.store(1, std::memory_order_seq_cst); ...
Jonny0201's user avatar
  • 513
4 votes
1 answer
136 views

I am wondering why exceptions inside joined thread invoke std::terminate and detached threads do not invoke std::terminate. Consider following snippet that triggers std::terminate. If we replace t2....
vocasle's user avatar
  • 889
1 vote
1 answer
99 views

On macOS, with Swift, is there any way to suspend and resume threads from the outside? I want to make sort of a manager of tasks. You can launch tasks (every task is a function running in a separate ...
Kaven's user avatar
  • 491
1 vote
0 answers
126 views

Upon upgrading to Spark 4, we get (deterministically) an IllegalThreadStateException in long series of queries including spark.ml or Delta Lake (e.g. in estimator.fit()) in the same long-running Spark ...
Ghislain Fourny's user avatar
2 votes
1 answer
80 views

I'm trying to optimize a section of the app by switching the single processing of a collection into running parallel under a lambda function. I am building my KieContainer once as follows: /** * From ...
Thom's user avatar
  • 15.3k
0 votes
1 answer
38 views

In our code we have seen a deadlock when using both the Wait and WaitAsync variant of the SemaphoreSlim. The class "Adder" below is a slimmed down version of what we have in our code: class ...
David van Luijk's user avatar
0 votes
0 answers
98 views

I'm creating an implementation of Minesweeper using JavaFX. Here, I have some code that runs in another thread and updates the GUI with the state of the game. It loops thru all the cells on the board ...
Foxler2010's user avatar
4 votes
1 answer
101 views

I know that, for POSIX shared and robust mutexes, if the process holding them crashes, the next process trying to acquire the lock will successfully call pthread_mutex_lock, which will return ...
Alessandro Bertulli's user avatar
0 votes
1 answer
185 views

Can I access PropertyInfo from the same System.Type from multiple threads? Can I call the same PropertyInfo.GetValue on different objects from multiple threads?
Houp's user avatar
  • 171
-2 votes
1 answer
132 views

As per my understanding it is fine to assign the thread object and call join function in C++ 11. eg as below : #include <iostream> #include <thread> using namespace std; void func() { ...
user3772439's user avatar
1 vote
0 answers
29 views

We are using Quarkus 3.15.3.1, Java 21 and JSONata4Java version 2.5.1. We want to optimize JSONata usage, so we prepare expressions for JSONata transformations like this Map<String, Expressions> ...
Matej Lipták's user avatar
0 votes
0 answers
109 views

I'm trying to implement a lock-free hashmap in C.(It doesn't actually free the elements when removing, I'm letting memory leak until it's destroyed). A node contains value, next ptr, and char array ...
archixe's user avatar
0 votes
0 answers
113 views

I'm working on a Rails 7 app where we're using the classic ||= memoization pattern in a service object that handles some complex reporting logic. We've started seeing some bizarre race conditions in ...
bragboy's user avatar
  • 35.7k
2 votes
2 answers
363 views

I have a simple code that you can run (the logging is to differentiate 4 workers): import time import random import logging import logging.handlers from multiprocessing.dummy import Pool def ...
hobbes3's user avatar
  • 30.7k
4 votes
3 answers
236 views

An example of producer and consumer threads is usually given. But this can be done with two semaphores. Why do we need condition variables then? Example with pthread library: // write thread while(1) {...
FlameWare's user avatar
0 votes
1 answer
56 views

I have added a music button to my Tkinter GUI, when I press it, it plays music but the other aspects wont work such as clicking other buttons and moving the window, I have tried threading but still no ...
Ac1234's user avatar
  • 1
0 votes
0 answers
105 views

For example, When I multithread a "for loop" using OpenMP, making the iterations as different threads, How does it get translated to Assembly? Also can a multithreaded code run on hardware ...
Ali Asgar 3's user avatar
1 vote
1 answer
127 views

I have following job in spring boot application: @Scheduled(cron = "0/5 * * * * *") fun processDocumentsBatch() { log.info("job has started") Thread.sleep(7000) log....
gstackoverflow's user avatar
2 votes
2 answers
194 views

Let's say I have following class class MyClass { std::binary_semaphore sem{0}; std::binary_semaphore& sem(); // just returns the semaphore // some other members } And I have some global ...
user15955526's user avatar
2 votes
0 answers
83 views

I'm training deep learning models using TensorFlow (with GPU support) on my local machine. I noticed a surprising behavior: When I train just one model (in a single terminal), it runs slower. But ...
Palantir's user avatar
5 votes
1 answer
166 views

I'm encountering an issue where my program is faster than std::reduce with std::execution::par enabled. I highly doubt that my code is more optimized, especially considering the fact that I am using ...
Seyed Mohammad Hamidi's user avatar
2 votes
3 answers
221 views

We insert some keys into a std::map in a single thread. Then in multiple threads, we get values using operator[] for some keys; these keys are guaranteed to have been inserted in the first step. (No ...
Xellos's user avatar
  • 752
0 votes
1 answer
120 views

I have a multi-threaded application where one producer thread updates market data for multiple instruments, and multiple consumer threads read this data to compute spot prices based on strategies like ...
Roger World's user avatar
0 votes
2 answers
148 views

I know std::jthread got introduced in C++20. And also std::async which got introduced in C++11 which as per my knowledge internally makes use of C++11 std::thread. So I want to know, has std::async ...
Harry's user avatar
  • 4,132
1 vote
2 answers
165 views

Let's say i have following classes class MyClass { private: std::string data_; public: MyClass(const std::string& data) : data_(data) {} void func() { ...
user15955526's user avatar