June 2017
Intermediate to advanced
478 pages
13h 14m
English
The big advantage of threads is that they share the address space and can share memory variables. This is also a big disadvantage because it requires synchronization to preserve data consistency in a manner similar to memory segments shared between processes but with the proviso that, with threads, all memory is shared. In fact, threads can create private memory using thread local storage (TLS), but I will not cover that here.
The pthreads interface provides the basics necessary to achieve synchronization: mutexes and condition variables. If you want more complex structures, you will have to build them yourself.
It is worth noting that all of the IPC methods described earlier, that is sockets, pipes and message ...
Read now
Unlock full access