.net - waking up a thread from sleep in response to an event c# -
lets suppose have 3 threads a, b , c
a starts b whereas c independent thread no relation either or b. calls b work , sleeps waiting signal b or c wakeup , start doing work again.
how can cross thread event handling achieved in c# ?
use manualresetevent or autoresetevent (based on particular semantics desire; without more info it's hard more appropriate). create appropriate event object , share 3 threads. have thread a wait on event. either b or c can set event wake thread a.
Comments
Post a Comment