Why should we use wait() and signal() operation in multithreading applications?
I'm relatively new to multithreading and somewhat understand mutual exclusion but I need a better understanding of how wait() and signal() come into the equation.
It seems I'm achieving thread safety by only using lock() and unlock(). Am I wrong?
Can someone give me an example of wait/signal being used and wait and signal not being used with lock/unlock? What are the benefits to using wait/signal over just lock/unlock?
Thanks.