Click here to Skip to main content
       

.NET Framework

 
QuestionI want to store webservice method's XML output as string in C# PinmemberMember 982628125-Feb-13 0:21 
AnswerRe: I want to store webservice method's XML output as string in C# PinmvpEddy Vluggen25-Feb-13 8:20 
AnswerRe: I want to store webservice method's XML output as string in C# Pinmemberjschell25-Feb-13 9:01 
Question[VB.NET 2008] Compact Framework: how to start a single instance of an application Pinmembersteve_949661324-Feb-13 23:28 
AnswerRe: [VB.NET 2008] Compact Framework: how to start a single instance of an application PinmvpEddy Vluggen25-Feb-13 8:10 
GeneralRe: [VB.NET 2008] Compact Framework: how to start a single instance of an application Pinmembersteve_949661325-Feb-13 23:44 
GeneralRe: [VB.NET 2008] Compact Framework: how to start a single instance of an application PinmvpEddy Vluggen26-Feb-13 0:33 
QuestionEvent Handling between Threads PinmemberAeroClassics19-Feb-13 11:37 
Sorry for the cross post but this doesn't fit neatly into Silverlight/WPF!
 
I am asking this in the WPF forum because this is a WPF app but this question does not necessarily pertain to WPF, i.e. the UI thread.
 
Here is the scenario:
I have three (3) threads. Thread One (1) call it the Master Thread; Thread Two (2) is a Ethernet Comm thread; and Thread Three (3) is a GPIB comm thread. Both communication threads handle asynchronous communications from remote entities. At this time there is only one entity hanging off each comm type.
 
I have implemented a mix of EventWaitHandles and delegates. This all works pretty well. Just think this architecture is a bit ...... ugly. So which one is better/safer?
 
My concern is as follows. With delegates, for example, the Master thread registers an event handler with Thread 2 and an event handler with Thread 3 for messages that come in. Obviously data could come in near simultaneously. So Thread 2 encases a message in an EventArg and invokes the event on the Master thread. The Master Thread begins processing and then Thread 3 encases its message in an EventArg and invokes the event on the Master Thread. What happens? Does the Master Thread stop in the middle of handling the first event to service the second one? Does the second event wait until the first event is processed? What if Thread 2 gets another message and invokes the event again while the Master is processing the first event?
 
I wonder if using a queue and an manual Reset EventWaitHandle is not a better idea as the Thread 2 can check the status and wait until it is reset before putting the message in the queue and setting the EventWaitHandle again.
 
Opinions, please?
 
Thanks,
Doug
I am a Traveler
of both Time and Space

AnswerRe: Event Handling between Threads PinmemberGerry Schmitz19-Feb-13 19:25 
GeneralRe: Event Handling between Threads PinmemberAeroClassics20-Feb-13 4:45 
QuestionWays of implenting IEnumerable in VB PinmemberMike-MadBadger19-Feb-13 11:10 
AnswerRe: Ways of implenting IEnumerable in VB PinmemberMicroVirus13-Mar-13 11:56 
GeneralRe: Ways of implenting IEnumerable in VB PinmemberMike-MadBadger13-Mar-13 21:44 
Questionhow to manage exicution code Pinmembernanhesab18-Feb-13 0:58 
AnswerRe: how to manage exicution code PinmvpEddy Vluggen18-Feb-13 1:01 
AnswerRe: how to manage exicution code PinmemberSuper Lloyd18-Feb-13 1:33 
AnswerRe: how to manage exicution code PinmvpSandeep Mewara18-Feb-13 3:13 
Questionharvesting social images for bi concept image search Pinmemberkrish888817-Feb-13 16:32 
AnswerRe: harvesting social images for bi concept image search PinmemberN a v a n e e t h17-Feb-13 17:13 
AnswerRe: harvesting social images for bi concept image search PinmvpSandeep Mewara17-Feb-13 18:24 
AnswerRe: harvesting social images for bi concept image search PinmvpAbhinav S19-Feb-13 0:08 
AnswerRe: harvesting social images for bi concept image search PinmvpDave Kreskowiak19-Feb-13 1:45 
QuestionWhere to get Regasm and Gacutil? Pinmembercjb11015-Feb-13 0:54 
AnswerRe: Where to get Regasm and Gacutil? PinmemberRichard Deeming15-Feb-13 1:01 
GeneralRe: Where to get Regasm and Gacutil? Pinmembercjb11015-Feb-13 2:55 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 22 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid