Hi,
1 I think mutex is enough, why we need condition variable? I know I am something wrong here, please correct me.
2 pthread_mutex_lock().
"The mutex object referenced by mutex shall be locked by calling pthread_mutex_lock(). If the mutex is already locked, the calling thread shall block until the mutex becomes available."
How about the CPU usage for this period? I know there are two methods to notice the waiter: poll and event-driven. which method was used here ? Where can I got this info?
Thanks you very much!