jeudi 18 avril 2019

Sharing common data element between threads

I am trying to use c++ queue ,i know queue element can be accessed by existing threads, but i want to use same queue element to be used by all threads , e.g same video frame i want to use between thread1 and thread2 , once its processed by two threads i want to pop next video frame, in thread safe mode i know threads will access individual elements (queue element 1 by thread1 and queue element2 by thread2), but i want to access queue element 1 by both threads. i am unable to lock single buffer for both threads,please help me to share same queue element between threads

Aucun commentaire:

Enregistrer un commentaire