Click here to Skip to main content
15,888,733 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Firing an ICommand from a Style? Pin
Cracked-Down7-Mar-13 2:29
Cracked-Down7-Mar-13 2:29 
QuestionExtended Toolkit Editor Templates Pin
#realJSOP22-Feb-13 6:17
mve#realJSOP22-Feb-13 6:17 
QuestionIs Visual studio 2012 using WPF's WindowChrome trick ? Pin
Member 806124520-Feb-13 22:45
Member 806124520-Feb-13 22:45 
QuestionBuilding a GUI in WPF Pin
columbos1492720-Feb-13 21:32
columbos1492720-Feb-13 21:32 
AnswerRe: Building a GUI in WPF Pin
Wayne Gaylard20-Feb-13 22:15
professionalWayne Gaylard20-Feb-13 22:15 
QuestionAfter Upagrading Silverlight from .NET 4 to 4.5 WCF Stopped working Pin
Vimalsoft(Pty) Ltd20-Feb-13 6:54
professionalVimalsoft(Pty) Ltd20-Feb-13 6:54 
AnswerRe: After Upagrading Silverlight from .NET 4 to 4.5 WCF Stopped working Pin
Vimalsoft(Pty) Ltd20-Feb-13 8:16
professionalVimalsoft(Pty) Ltd20-Feb-13 8:16 
QuestionEvent Handling between Threads Pin
AeroClassics19-Feb-13 11:34
professionalAeroClassics19-Feb-13 11:34 
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 Pin
SledgeHammer0119-Feb-13 12:57
SledgeHammer0119-Feb-13 12:57 
GeneralRe: Event Handling between Threads Pin
AeroClassics20-Feb-13 4:42
professionalAeroClassics20-Feb-13 4:42 
Questionpanel with sorting animation Pin
tetrapack19-Feb-13 9:00
tetrapack19-Feb-13 9:00 
QuestionI know what's ItemTemplate, what's PropertyTrigger,DataTrigger and MultiTrigger but What's "TemplateTrigger"? Pin
devvvy15-Feb-13 18:29
devvvy15-Feb-13 18:29 
QuestionAbout Silver light Sql Data Connection Pin
vijaynet1014-Feb-13 19:14
vijaynet1014-Feb-13 19:14 
AnswerRe: About Silver light Sql Data Connection Pin
Mycroft Holmes15-Feb-13 0:45
professionalMycroft Holmes15-Feb-13 0:45 
GeneralRe: About Silver light Sql Data Connection Pin
vijaynet1015-Feb-13 4:30
vijaynet1015-Feb-13 4:30 
GeneralRe: About Silver light Sql Data Connection Pin
Pete O'Hanlon15-Feb-13 5:46
mvePete O'Hanlon15-Feb-13 5:46 
AnswerRe: About Silver light Sql Data Connection Pin
Abhinav S15-Feb-13 17:01
Abhinav S15-Feb-13 17:01 
QuestionIs it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan14-Feb-13 17:03
Dr. Hurol Aslan14-Feb-13 17:03 
AnswerRe: Is it safe to change datagridcolumn cell style at run time? Pin
Marco Bertschi15-Feb-13 3:12
protectorMarco Bertschi15-Feb-13 3:12 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan15-Feb-13 8:03
Dr. Hurol Aslan15-Feb-13 8:03 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Marco Bertschi15-Feb-13 8:04
protectorMarco Bertschi15-Feb-13 8:04 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Mycroft Holmes15-Feb-13 12:37
professionalMycroft Holmes15-Feb-13 12:37 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan15-Feb-13 14:43
Dr. Hurol Aslan15-Feb-13 14:43 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Mycroft Holmes15-Feb-13 14:53
professionalMycroft Holmes15-Feb-13 14:53 
QuestionSend mail at a specific time Pin
LG014-Feb-13 2:27
LG014-Feb-13 2:27 

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.