Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
GeneralRe: Input type ="image" in c# Pin
tedyboy98-Apr-10 21:07
tedyboy98-Apr-10 21:07 
QuestionManualResetEvent set()/waitOne() Pin
igalep1328-Apr-10 9:17
igalep1328-Apr-10 9:17 
AnswerRe: ManualResetEvent set()/waitOne() Pin
Luc Pattyn8-Apr-10 9:26
sitebuilderLuc Pattyn8-Apr-10 9:26 
AnswerRe: ManualResetEvent set()/waitOne() Pin
supercat98-Apr-10 9:44
supercat98-Apr-10 9:44 
GeneralRe: ManualResetEvent set()/waitOne() Pin
igalep1328-Apr-10 10:09
igalep1328-Apr-10 10:09 
AnswerRe: ManualResetEvent set()/waitOne() Pin
igalep1328-Apr-10 10:52
igalep1328-Apr-10 10:52 
GeneralRe: ManualResetEvent set()/waitOne() Pin
igalep1329-Apr-10 0:37
igalep1329-Apr-10 0:37 
GeneralRe: ManualResetEvent set()/waitOne() Pin
supercat910-Apr-10 13:21
supercat910-Apr-10 13:21 
igalep132 wrote:
the fact that write method is still under the mutex will prevent from unblocked reading thread/s to continue running ?


If the 'reader' threads are sitting on MRE.WaitOne, how is the writer thread going to reach MRE.Set? Won't the writer thread me stuck at MainMutex.WaitOne since the reader thread will hold the mutex during Mre.WaitOne?

I would suggest that the best approach is to have the queue reader, if the queue is empty, reset MRE, leave the main mutex, and wait on MRE; the queue writer should set MRE unconditionally within the mutex. After every time the reader waits on MRE, it should re-check to see if the queue is empty; if not, it should re-loop.

It's tricky logic to get right, and I might have made a mistake in my description above; using the Monitor class will make things easier, but I think mutexes and manual-reset events should work.
QuestionLegal issue - Using controls from Code Project in commercial applications Pin
ekareem8-Apr-10 8:11
ekareem8-Apr-10 8:11 
AnswerRe: Legal issue - Using controls from Code Project in commercial applications Pin
EliottA8-Apr-10 8:45
EliottA8-Apr-10 8:45 
AnswerRe: Legal issue - Using controls from Code Project in commercial applications Pin
Not Active8-Apr-10 9:46
mentorNot Active8-Apr-10 9:46 
Questionusing a delayed sign assembly Pin
prasadbuddhika8-Apr-10 6:37
prasadbuddhika8-Apr-10 6:37 
Questionwrite a program like windows magnify Pin
itresearches8-Apr-10 5:09
itresearches8-Apr-10 5:09 
AnswerRe: write a program like windows magnify Pin
EliottA8-Apr-10 8:50
EliottA8-Apr-10 8:50 
QuestionAccessing to a control created at runtime Pin
aleroot8-Apr-10 5:05
aleroot8-Apr-10 5:05 
AnswerRe: Accessing to a control created at runtime Pin
OriginalGriff8-Apr-10 5:28
mveOriginalGriff8-Apr-10 5:28 
GeneralRe: Accessing to a control created at runtime Pin
aleroot8-Apr-10 5:40
aleroot8-Apr-10 5:40 
GeneralRe: Accessing to a control created at runtime Pin
aleroot8-Apr-10 9:42
aleroot8-Apr-10 9:42 
QuestionPassing database login info to Crystal report - problem going to production Pin
jamesc698-Apr-10 4:54
jamesc698-Apr-10 4:54 
Questionstatic property with polymorphism Pin
lukeer8-Apr-10 4:12
lukeer8-Apr-10 4:12 
AnswerRe: static property with polymorphism Pin
PIEBALDconsult8-Apr-10 4:28
mvePIEBALDconsult8-Apr-10 4:28 
GeneralRe: static property with polymorphism Pin
lukeer8-Apr-10 4:34
lukeer8-Apr-10 4:34 
AnswerRe: static property with polymorphism Pin
Jimmanuel8-Apr-10 4:38
Jimmanuel8-Apr-10 4:38 
AnswerRe: static property with polymorphism Pin
Luc Pattyn8-Apr-10 4:46
sitebuilderLuc Pattyn8-Apr-10 4:46 
AnswerRe: static property with polymorphism Pin
PIEBALDconsult8-Apr-10 5:06
mvePIEBALDconsult8-Apr-10 5:06 

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.