3 ms·
Because at some point data has to be exchanged across threads. For example a task queue might have tasks that can independently executed in a thread pool, but t
by NL807 3y ago
Because at some point data has to be exchanged across threads. For example a task queue might have tasks that can independently executed in a thread pool, but the queue index has to be atomically modified when some other thread emplaced a new task. Or if you want to transfer ownership of a heap allocated object between threads, you need to atomically transfer the pointer, or modify the reference count of that pointer. Things like that.