Event Driven Code and Thread Control



Hello. First post, but been doing a bit of reading here. I am working on a project in Java, but decided to switch over to C# after seeing some of the additional features I can get from C#. One of the big changes I want to make is event-driven code (rather than the linear flow I had in Java). I have spent a week or so searching Google, talking to a couple of programming friends, and just chewing on it in my brain. I think I have an ok handle on delegates (new to me), but I'm still having some issues and could use some help to push me along in the right direction.

Here is a quick run-down of the program (well, what I had in mind anyway). There is a GUI thread, a main processing thread (handles parsing, updating the objects, etc - this could also been on the GUI thread, but not sure if that is proper design. This would basically be the worker thread where all the data is actually manipulated), and 2 input threads (1 socket reading from another application, and 1 file also reading from that same other application). Both the input threads will be reading data that will affect the same objects (although most updates will not be of the same attributes). I'd like for the 2 input threads to fire events at the main processing thread when they get information. I'd like for that information to be placed onto the main processing thread when received by it. I'd also like for this to happen 'instantly' and not use a queue on a timer check (something I was doing in the Java linear version).

So that's basically where I'm at with it. I have searched Google for c# info on 'event-driven code', 'delegate marshal thread', etc to try and put this all together, but I'm not really finding the answers I need. Most of the marshal information relates to placing it back onto a UI thread (which could work, but again not sure if that would be good design), not a specified thread. And this is where I could really use some help. Can I marshal to a thread I specify? If so, are there any examples, tutorials, etc?

Any help is greatly appreciated.

Brad

.



Relevant Pages

  • Re: Event Driven Code and Thread Control
    ... In Microsoft Windows there is a message pump going around. ... There is a GUI thread, a main processing thread (handles parsing, updating the objects, etc - this could also been on the GUI thread, but not sure if that is proper design. ... This would basically be the worker thread where all the data is actually manipulated), and 2 input threads (1 socket reading from another application, and 1 file also reading from that same other application). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
    ... >> A few months ago I had an introductory class on Java programming. ... reading from console can be done via a call to ... just one character at a time). ... Stream reader, or an HTTP Input Stream reader, or an Audio Input Stream ...
    (comp.lang.cobol)
  • Re: CLOS and databases
    ... No-one programs in Java if they ... I've experienced the frustration of loving Common Lisp but being forced ... Common Lisp macros) to hide all the mess. ... Reading PRIMES/0000000000000000001.transactionLog... ...
    (comp.lang.lisp)
  • Reading in chunks of data
    ... I'm reading up on the use of the RandomAccessFile (and other file I/O) ... classes in Java but I haven't found anything that can help me. ...
    (comp.lang.java.programmer)
  • Re: When were JSF and JavaBeans created and is this the "correct" way to build web pages in Java te
    ... I started reading about JSP and Servlets. ... found Java Server Faces and JavaBeans. ... Look for framework like Struts. ... JSF is just the newest and official way of achieving the same. ...
    (comp.lang.java.programmer)