Threading - deadlock?

Started by
2 comments, last by Kylotan 15 years, 1 month ago
I am currently attempting to separate the CPU from the GPU and allow the GPU to run in paralell with the CPU. I have written code to do this, but the thread which does the CPU processing creates threads within itself and calls wait() to wait for them to finish. Whenever I call wait within this thread, the application hangs. Im unsure why this is, as I understand wait() would stop the current thread of exectuion and wait for the other threads to finish. FWIW im using boost::threadpool (an extension to boost). If there is an alternative implimentation method to this, please let me know. Ashley.
Advertisement
Quote:Original post by Asheh
I am currently attempting to separate the CPU from the GPU and allow the GPU to run in paralell with the CPU.

It already does that without your help, you know. ;)
Quote:I have written code to do this, but the thread which does the CPU processing creates threads within itself and calls wait() to wait for them to finish. Whenever I call wait within this thread, the application hangs. Im unsure why this is, as I understand wait() would stop the current thread of exectuion and wait for the other threads to finish.

There will be no visible difference between hanging and waiting for the other threads to finish if you can't guarantee that the other threads will finish. That would be the first thing to check in my opinion.
So its not possible to queue up data to be ready for the cpu while im waiting for the gpu to finish?
Your program is still running while the GPU is doing whatever it does. That's the whole point of having a GPU, in fact. But I get the feeling that's not exactly what you mean, so perhaps you could specify in more detail exactly what you're trying to achieve?

This topic is closed to new replies.

Advertisement