Click here to Skip to main content
15,910,878 members
Home / Discussions / C#
   

C#

 
GeneralRe: C#: Method help Pin
Anthony Mushrow21-Nov-07 7:53
professionalAnthony Mushrow21-Nov-07 7:53 
QuestionI need a Sample code! Pin
Davood Riazi21-Nov-07 5:00
Davood Riazi21-Nov-07 5:00 
AnswerRe: I need a Sample code! Pin
Colin Angus Mackay21-Nov-07 5:32
Colin Angus Mackay21-Nov-07 5:32 
GeneralRe: I need a Sample code! Pin
Davood Riazi25-Nov-07 3:40
Davood Riazi25-Nov-07 3:40 
QuestionHow to count pixels Pin
A.Asif21-Nov-07 4:35
A.Asif21-Nov-07 4:35 
AnswerRe: How to count pixels Pin
V.21-Nov-07 4:47
professionalV.21-Nov-07 4:47 
AnswerRe: How to count pixels Pin
Skippums21-Nov-07 6:06
Skippums21-Nov-07 6:06 
QuestionHow to know if a thread is waiting for an event ?! Pin
Karma Komae21-Nov-07 4:14
Karma Komae21-Nov-07 4:14 
Hello there,

Well, my question is quite simple, i'm working on synchronization between threads, and one thing i'd like to know is if there's a way to know if a thread is paused by an event.WaitOne() ...

Imagine the code below, using an eventGate declared as a ManualResetEvent acting like a gate (eventGate.Set ()= gate open, eventGate.Reset() = gate closed) :

private void myThread(){
    while(!stop){
        eventGate.WaitOne();
        anyFunction(); //Lasting for a random time between some millisec to a few seconds
    }
}


Is there a way to know if i am now waiting in the WaitOne() function ?! Because i really need to in order to process the other commands in the other threads i got !

Best Regards,

Mamat,

AnswerRe: How to know if a thread is waiting for an event ?! Pin
Luc Pattyn21-Nov-07 4:35
sitebuilderLuc Pattyn21-Nov-07 4:35 
GeneralRe: How to know if a thread is waiting for an event ?! Pin
Karma Komae21-Nov-07 4:52
Karma Komae21-Nov-07 4:52 
GeneralRe: How to know if a thread is waiting for an event ?! Pin
Luc Pattyn21-Nov-07 9:45
sitebuilderLuc Pattyn21-Nov-07 9:45 
GeneralRe: How to know if a thread is waiting for an event ?! Pin
Karma Komae21-Nov-07 23:05
Karma Komae21-Nov-07 23:05 
GeneralRe: How to know if a thread is waiting for an event ?! Pin
Luc Pattyn21-Nov-07 23:51
sitebuilderLuc Pattyn21-Nov-07 23:51 
QuestionHow to Open Url Pin
A.Asif21-Nov-07 3:54
A.Asif21-Nov-07 3:54 
AnswerRe: How to Open Url Pin
Skippums21-Nov-07 5:58
Skippums21-Nov-07 5:58 
QuestionReading data from ms sql Pin
RAGHAVENDRAN200721-Nov-07 3:06
RAGHAVENDRAN200721-Nov-07 3:06 
AnswerRe: Reading data from ms sql Pin
duncanmhor21-Nov-07 4:06
duncanmhor21-Nov-07 4:06 
QuestionForm.ShowDialog(), but without Focus Pin
blackjack215021-Nov-07 2:41
blackjack215021-Nov-07 2:41 
AnswerRe: Form.ShowDialog(), but without Focus Pin
Skippums21-Nov-07 5:27
Skippums21-Nov-07 5:27 
GeneralRe: Form.ShowDialog(), but without Focus Pin
blackjack215021-Nov-07 6:45
blackjack215021-Nov-07 6:45 
QuestionLoading an image into a toolStripStatusLabel Pin
Programm3r21-Nov-07 2:02
Programm3r21-Nov-07 2:02 
AnswerRe: Loading an image into a toolStripStatusLabel Pin
Andrei Ungureanu21-Nov-07 2:38
Andrei Ungureanu21-Nov-07 2:38 
GeneralRe: Loading an image into a toolStripStatusLabel Pin
Programm3r21-Nov-07 3:29
Programm3r21-Nov-07 3:29 
QuestionSend Messages to Mobile Devices Pin
Satish - Developer21-Nov-07 1:47
Satish - Developer21-Nov-07 1:47 
AnswerRe: Send Messages to Mobile Devices Pin
Vasudevan Deepak Kumar21-Nov-07 3:24
Vasudevan Deepak Kumar21-Nov-07 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.