Please enable JavaScript.
Coggle requires JavaScript to display documents.
POSIX Threads (Attributes (schedparam (Partner to schedpolicy and allows…
POSIX Threads
Attributes
-
-
-
-
-
stacksize
Controls the thread creation stack size, set in bytes
Threads Advantages
-
The performance of an application that mixes input, calculation, and output may be improved by running these as three separate threads
-
Threads drawbacks
-
Debugging a multithreaded program is much, much harder
A program that splits a large calculation into two and runs the two parts as different threads will not necessarily run more quickly on a single processor machine
Synchronization
-
Mutexes
-
-
To control access to a critical section of code you lock a mutex before entering the code section and then unlock it when you have finished
Canceling a Thread
Given a thread identifier, you can request that it be canceled
-