I am trying to implement a producer consumer model to separate the analysis and recording the data (collected from analysis) part of my pin tool. Going through the PIN thread API, I could not find any functions which can suspend a thread based on some predicate or signal a thread to resume (like pthread_cond_wait()
and pthread_cond_signal()
in POSIX threads). So, is there any workaround to achieve the producer consumer model using existing functions while avoiding busy-waiting.
NOTE: Both producer and consumer threads are internal threads created by PIN_SpawnInternalThread()
.