Top "Thread-safety" questions

A piece of code is thread-safe if it only manipulates data structures in a way that allows consistent execution of this code by multiple threads.

Always declare std::mutex as mutable in C++11?

After watching Herb Sutter's talk You Don't Know const and mutable, I wonder whether I should always define a mutex …

c++ c++11 thread-safety constants mutable
strtok function thread safety

I have been spending some time in debugging a programme which gives segmentation fault. The bug is quite indeterministic and …

c linux thread-safety strtok
The method runOnUiThread(Runnable) in the type Activity is not applicable for the arguments (void)

I am trying to create a dialog from a non-UI thread, in onUtteranceCompleted(): runOnUiThread( new Thread(new Runnable() { public void …

android dialog thread-safety runnable ui-thread
BlockingCollection(T) performance

For a while at my company we've used a home-grown ObjectPool<T> implementation that provides blocking access to …

.net collections thread-safety blocking objectpool
C++11 Thread safety of Random number generators

In C++11 there are a bunch of new Random number generator engines and distribution functions. Are they thread safe? If …

c++ thread-safety c++11 openmp grand-central-dispatch
Are Axis2 generated stubs thread-safe?

Are client stubs generated from WSDL by Axis2 thread-safe? Of course, "thread-safe" isn't necessary a rigorously defined term, so I'm …

java web-services multithreading thread-safety axis2
"StringBuffer is synchronized (or thread-safe) and StringBuilder is not", why does this make StringBuffer methods slower?

After reading this - What does 'synchronized' mean? I was still unable to understand why StringBuffer would be slower than …

java synchronization thread-safety stringbuilder stringbuffer
How to return a thread safe/immutable Collection in Java?

In the project I am coding, I need to return a thread safe and immutable view from a function. However, …

java list thread-safety synchronized unmodifiable
Disable JButton, while background job, to avoid multiple clicks

I need to stop user making multiple clicks on a JButton while the first click still execute. I was able …

java swing thread-safety jbutton
Ruby/Rails thread safety

I have been hacking with Ruby from time to time, but I haven't done anything big or multithreaded with it. …

ruby-on-rails ruby multithreading thread-safety jvm-languages