Eric Lippert has a nice blog post entitled What is this thing you call “thread safe”? about the definition of thread safety as found of Wikipedia.
3 important things extracted from the links :
“A piece of code is thread-safe if it functions correctly during simultaneous execution by multiple threads.”
“In particular, it must satisfy the need for multiple threads to access the same shared data, …”
“…and the need for a shared piece of data to be accessed by only one thread at any given time.”
Definitely worth a read!
Related Posts:
- What is a “thread” (really)?
- What is a mutex?
- What is a race condition?
- What’s the difference between deadlock and livelock?
- What’s a Pthread?
- What is the difference between a process and a thread?
- What is the meaning of the term “thread-safe”?
- What are atomic operations for newbies?
- No enclosing instance of type is accessible.
- How to use multiprocessing queue in Python?
- Multiprocessing vs Threading Python
- Android “Only the original thread that created a view hierarchy can touch its views.”
- Proper use of mutexes in Python
- Why does PyQt crashes without information? (exit code 0xC0000409)
- Why does PyQt crashes without information? (exit code 0xC0000409)
- PyQt is thread-safe to the same extent that Qt is thread-safe. The Qt docs will tell you which parts of their API are guaranteed to be so, and under what circumstances.
- How to avoid Not on FX application thread; currentThread = JavaFX Application Thread error?
- Java Wait for thread to finish
- Semaphore vs. Monitors – what’s the difference?
- Why PTHREAD_COND_INITIALIZER may be used to initialize a condition variable only when it is declared?
- Difference between volatile and synchronized in Java
- Difference between user-level and kernel-supported threads?
- software threads vs hardware threads
- What is an idempotent operation?
- pthread_join() and pthread_exit()
- What is a loop invariant?
- What is a loop invariant?
- SOAP vs REST (differences)
- Python time.sleep() vs event.wait()
- What is boilerplate code?
- What is an example of the Liskov Substitution Principle?
- Undefined reference to pthread_create in Linux
- Mutex example / tutorial? [closed]
- How to fix a “invalid operands to binary expression” error?
- What does a lock statement do under the hood?
- Error with multiple definitions of function
- What exactly is std::atomic?
- C++ terminate called without an active exception
- Thread pooling in C++11
- Timeout on a function call
- Collection was modified; enumeration operation may not execute
- What is the meaning of “exclusive” and “inclusive” when describing number ranges?
- Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
- The calling thread cannot access this object because a different thread owns it
- What does java.lang.Thread.interrupt() do?
- pthread sleep linux
- Is there any way to kill a Thread?
- How do I define string constants in C++?
- How to pause / sleep thread or process in Android?
- Definition of ui-sref in Angular.js?
- local variables referenced from an inner class must be final or effectively final
- Why doesn’t JavaScript support multithreading?
- Thread-safe List
property - java.lang.IllegalMonitorStateException: object not locked by thread before wait()?
- WSACancelBlockingCall exception
- “Multiple definition”, “first defined here” errors
- C# Foreach statement does not contain public definition for GetEnumerator
- The application may be doing too much work on its main thread
- Task vs Thread differences
- What is a loop invariant?
- What is the difference between a heuristic and an algorithm?
- How to use WPF Background Worker
- How can I wait for a thread to finish with .NET?
- OpenMP set_num_threads() is not working
- How to “wait” a Thread in Android
- java.lang.IllegalThreadStateException
- Service vs IntentService in the Android platform
- When should you use multithreading? And would multi threading be beneficial if the different threads execute mutually independent tasks?
- Difference between volatile and synchronized in Java
- Can I get Unix’s pthread.h to compile in Windows?
- What is an example of the Single Responsibility Principle?