If you don't let the queue process its events, they'll wait there. Just be aware that your application won't respond/redraw during that time.
If you don't let the queue process its events, they'll wait there. Just be aware that your application won't respond/redraw during that time.
TheGrimace (5th October 2007)
Well, in my case the GUI is in a separate thread from the thread that will have a waiting event loop. Does the event loop wait until a slot has finished before handling another signal? I think my logic may be flawed.
I was thinking along these lines.
ExampleOne objects send a string to MiddleObject which then funnels it on request to ExampleTwo objects.
So like this:
ExampleOne -> (string) -> MiddleObject -> (string) -> ExampleTwo
Both ExampleOne objects and ExampleTwo objects speak to MiddleObject through signals/slots. Right now I am a little worried about a deadlock situation where a slot holds onto the thread and doesn't allow another slot to process.
The event loop processes events sequentially. So provided that emiter and receivers are in the same thread, slots won't be run concurrently.
TheGrimace (5th October 2007)
As a potential solution, I was thinking the following: whenever a signal is processed, if the condition is not ready, sleep briefly and emit a signal with the same variables. My concern is that the signal would be processed as a direct connection. If I forced a queued connection would the other signals get a chance to process? Thank you for the help.
But what exactly is your goal?
I am creating a thread pool to handle file processing. I get the file names from multiple threads of ExampleOne. These file names are held in a queue in MiddleObject until a signal is received from ExampleTwo (of which there might be many objects) This ExampleTwo object will then process the file and when its done ask for another.
My concern is the ExampleTwo signals blocking the ExampleOne signals which populate the queue.
But what do you need signals for? Isn't it better to have a wait condition so that all threads wait there until there is anything to do? You could have then a single controller object where you could store jobs and start/stop threads.
I don't think I understand. How do you transfer information across threads if not by signals/slots?
Through a common variable.
TheGrimace (5th October 2007)
Ok, Thank You
Bookmarks