Hi all!
I'm developing an application that use a thread for load and draw some images. When the images are drawed, I set the thread state to sleep with the WaitOne method. Then, the application wake up the thread using the Set method. Now, during the execution, the application used about one second for wake up the thread. :S
By the theory, this should be a fast operation, but it isn't. Seem the thread run synchronously, and not asynchronously, as should be.
Why it takes a lot of time?
Have you any idea about this?
Thank you a lot!
Loading
EnricoPosted Jun 21, 2010, 5:03 AM
The application wake up the worker thread with the Set method. I used the AutoResetEvent class for handle the thread.
I don't understand!
Sam HobbsPosted Jun 21, 2010, 2:40 AM
Also, how does the application wake up the worker thread?
EnricoPosted Jun 20, 2010, 5:41 PM
I have not been precise in my question. The worker thread open some images and put them into a buffer, but not draw them. The draw in the screen is made by the main thread in another time. I hope the issue is now clearer.
After the wake up by the application, the worker thread load and put the images into a buffer. When it has complete, its suspended. After, the application draw the content of buffer and wake up the worker thread that do its work.
There is a lot of time, about one second, that the application used to wake up the thread. Is it possible?
Sam HobbsPosted Jun 20, 2010, 5:20 PM
What does the thread do for the second after the application wakes it up?