Questions tagged [thread-synchronization]

In a multi-threaded environment thread synchronization is used to coordinate access to shared resources such as file handles, network connections, and memory

In a multi-threaded environment thread synchronization is used to coordinate access to shared resources such as file handles, network connections, and memory

References

645 questions
0
votes
1 answer

Thread synchronization with multiple objects

I have been facing this problem for many days, Please help me out. I am implementing producer-consumer example using thread synchronization. I have made some twist in this traditional program. Instead of using only one queue object, i have used two…
0
votes
1 answer

Threading synchronization issue, 3 threads running concurrently, the 4th must run while others are waiting

Sorry for the title, I couldn't find better to explain my issue... I'm having a hard time trying to synchronize different threads in my application. It's probably an easy problem for someone that has a new look on the issue, but after hours of…
ken2k
  • 48,145
  • 10
  • 116
  • 176
0
votes
1 answer

Cache, synchronizing threads only when updating the resource

I've read quite a lot on SO and other sites about cache and thread synchronization, but I still can't get an answer to my question. .NET Thread Safety for Static Dictionary Cache How does lock work exactly? Why are locks performed on separate…
ppetrov
  • 3,077
  • 2
  • 15
  • 27
0
votes
6 answers

threads accessing non-synchronised methods in Java

can I ask to explain me how threads and synchronisation works in Java? I want to write a high-performance application. Inside this application, I read a data from files into some nested classes, which are basically a nut-shell around HashMap. After…
0
votes
1 answer

Getting multi-threading to synchronize between web page and Business layer

I'm having a problem getting this chunk of code to work (sorry for the length). The code is sterilized to just show the relevant portions in diagnosing the problem. It works fine when run from a console app. But when Utlities.SendBulkEmail is…
0
votes
1 answer

overhead of thread-synchronization via Events

I am experimenting with multithreaded synchronization at the moment. For a backround I have a set of about 100000 objects - possibly more - I want to process in different ways multiple times per second. Now the thing concerning me most is the…
0
votes
3 answers

perform functions synchronously

i have a few functions that have to be implemented synchronously for 3 seconds. i have a sound being played using soundpool, a vibration pattern, and a background animation. all three of them work fine separately. but i am not able to time them…
newbee
  • 409
  • 2
  • 12
  • 34
0
votes
1 answer

Synchronize Threads with WINAPI

I would like to synchronize threads with WINAPI calls only but I have no success. The situation is to LOG activities with time and date as soon as my WNDPROC gets a message. The problem is that my WNDPROC needs to write to the log and it will get…
Ben
  • 3,380
  • 2
  • 44
  • 98
0
votes
1 answer

Where to call __syncthreads() function in CUDA

I have some bool variable , and my each threads must work with that , So I need to synchronise them it means I need to call __syncthreads() function in my program , but I don't know where to call it.
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
0
votes
2 answers

Thread synchronization in WinCE

I have faced with a problem of threads synchronization. My presenter analyzes some sensors and update UI form. I moved updating code into separate thread. It works fine, but if the user stops presenter when it is updating the view, the software…
0
votes
2 answers

Thread synchronization inside if/else block in CUDA

I want to implement Gaussian elimination in CUDA. But I have problem with thread synchronization inside if/else. Here is my simple code: __device__ bool zr(float val) { const float zeroEpsilon = 1e-12f; return fabs(val) <…
pablo
  • 384
  • 2
  • 5
  • 17
0
votes
0 answers

QObject that waits for a specific call from outside (async result wrapper similar to QFuture)

I want to write a class (QObject-derived) that can wait for someone calling a specific function. This class will then be used to hold the result of an asynchronous operation (behind the scenes it's a remote procedure call). The interface of the…
leemes
  • 44,967
  • 21
  • 135
  • 183
0
votes
4 answers

Threading and Synchronization

I need to create a java program for the following: Create an ArrayList to store the names of the employees. Create two synchronized methods to add the employee names to the ArrayList and print the employee names. Print the employee names once both…
Robin
  • 147
  • 10
0
votes
1 answer

Does multiple QMutex needed for every critical section?

Should i define one QMutex for all of my critical sections? or i should define one QMutex for each critical sections? is there any identical concept in Qt like lock(object) {...} in c Sharp?
Mohsen Zahraee
  • 3,309
  • 5
  • 31
  • 45
0
votes
0 answers

Thread Synchronization in android

I have Two services Service A Service B Service c Service A Code: public class ServiceA extends Service { @Override public IBinder onBind(Intent arg0) { return null; } @Override public void onCreate() { super.onCreate(); …
Bucks
  • 689
  • 3
  • 11
  • 28