Questions tagged [ynchronizationontext]

4 questions
2
votes
1 answer

Could SynchronizationContext be used not in WinForms/WPF application?

I'm writing a component that would be used in WinForms or WPF applications also could be used in Windows services or Unit tests. Is there a way to use SynchronizationContext component in non UI apps?
Kimi
  • 13,621
  • 9
  • 55
  • 84
2
votes
1 answer

SynchronizationContext.Post(...) in transport event handler

We have a method which, due to threading in the client application requires the usage of SynchronizationContext. There is a bit of code which one of my colleagues has written which doesnt "feel" right to me, and a performance profiler is telling me…
miguel
  • 2,961
  • 4
  • 26
  • 34
0
votes
1 answer

Can SynchronizationContext.Post or .Send lead to exceptions?

I've read all recommended articles on SynchronizationContext, but there is one small question I did not find an answer for. In my case I have an event handler that calls a Log() method that outputs text to a TextBox. Log() is called from a WCF…
John
  • 3,591
  • 8
  • 44
  • 72
0
votes
1 answer

C# Thread in Thread: how to get SynchronizationContext.Current?

I have a WindowsForms application wich has SynchronizationContext.Current not null But from that WindowsForms app I create a new Thread called thread1 From thread1 I create another Thread called thread2 When I try to POST methods from thread2 in…
Sorin
  • 2,258
  • 4
  • 27
  • 45