Hanzibal is right. Main() calls an infinite loop and never exited. The scheduler just never returned to the main thread. The interesting thing is the other threads ran fine. If I move output0.Flash() to a third thread then all the lights flashes simultaneously. So how is the Main Thread different from other threads? Also if I run the code in debug under VS then it behaves properly, despite the lights flash much slower because of the debugger communication. Is this a SDK, firmware or .NET MF defect?
The reason I do not want to put a Thread.Sleep() is I need to monitor the input pins as frequently as possible. My actual project currently only runs under the main thread and the main loop iterates 3 times a ms. As I am adding more functionality to the program multi-threaded application will become much cleaner and easier to maintain, but I can't afford to put a 1ms sleep without changing a lot of code. Is there a way to sleep less, i.e. 1/2 ms?
I also wonder how much performance overhead does the thread scheduler take? i.e If I put 2 loop counters on 2 threads and add the counters together (a+, vs. one thread with loop counter c. What is the ratio of (a+ : c? I will give it a try when I have time and report.