Sign in to follow this  
Asheh

Threading - deadlock?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
So its not possible to queue up data to be ready for the cpu while im waiting for the gpu to finish?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this