How can one create a thread in unix programming?
What is difference between forking and threading?
Is threading more useful than forking?
One usually uses POSIX threads or some other technology wrapped by its API. Forking starts new processes, threading splits an existing process into pieces. Threading results in shared global state, which may or may not be useful given the specific circumstances.
pthread_create()
Forking creates two processes, each having a separate thread of control. Creating a thread creates an extra thread of control within a single process.
No - it is generally harder to get threaded applications right than it is to get separate processes right. And by quite a large margin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With