.code.. Hello Earthling .. \o/ :)
do you know a way around this, or how to resolve this issue with the suspend and resume methods?
could you post some sample code or give me a site that will fix this error for me?
Hi, this *issue* cannot be fixed by just any of the available methods. Its a problem of thread synchronisation. The document, as I wrote, points out clearly that you should use the classes available in System.Threading such as Event etc. Now it can be confusing to understand incase you are new to thread synchronization. In that case you should look for articles on internet related to thread synchronisation in C#/vb.net. Regarding thread.suspend: its wrong, in the first place, to suspend your thread through a thread.suspend or a sleep statement just because you *expect* something to have happened by the time your wait time expires. For example:Post a Comment
Sleep (1000); // or a suspend statement here
I would say its a wrong design. Instead you should have some thread synchronisation object on which you could wait, and that wait should be released by the task on which you are waiting. I know how this kind of code is written in c++ but I dont clearly remember what classes to use in C# since i havnt worked on it for quite some time (but Event class is one). I dont promise to write a blog post on this but I can say I'll try. But dont count on it :)
Links to this post:
Lahore Food Blog