You are not logged in.

1

Thursday, November 3rd 2005, 8:55pm

QQueue problem

I attempted to use QQueue to pass some information from one thread to many threads. In each of the sub threads, I call dequeue() and have learned that this causes problems since the queues all point to the same set of data. When an object is dequeued from one, it is destroyed and a subsequent dequeue() from another thread results in a seg fault.

Any suggestions for alternative data structures or does I need some redesign?

My application takes data from one thread and sends it across two separate serial points. I was hoping to just pass the queue from the main thread to the serial threads and have them each call dequeue()...

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

2

Thursday, November 3rd 2005, 10:15pm

RE: QQueue problem

How many queues do you have? Have you protected them with mutexes?