Re: Thread Doubt.
From: Ram (ramanasoory_at_hotmail.com)
Date: 11/24/04
- Next message: phreakstar: "RE: disabling"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: not buffered file reader"
- In reply to: John Murray: "Re: Thread Doubt."
- Next in thread: John Murray: "Re: Thread Doubt."
- Reply: John Murray: "Re: Thread Doubt."
- Reply: Thomas P. Skinner [MVP]: "Re: Thread Doubt."
- Reply: Willy Denoyette [MVP]: "Re: Thread Doubt."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 20:27:44 +0530
Ok. The problem goes like this: I have the main window that listens for
events from devices and COM components. The main window spawns childs (since
there are many to listen to) and starts listening. Whenever the main thread
receives events from these thread, the UI has to be updated. Now I want the
UI updation to happen in separate thread rather than in the main thread. So
I thought of having another thread just to paint and update the UI as I do
not want to overload the main thread as it has to listen for events from
other child thread.
I used to work with CWinThread in vc and everything seems to be possible for
me using PostThreadMessage. Here the equivalent of CWinThread is missing.(or
am I missing something ?)
I am new to C# and till now my exp are with vc. I have to try it out with
ThreadPool.
"John Murray" <jtm@io.com> wrote in message
news:et3sJLj0EHA.2804@TK2MSFTNGP15.phx.gbl...
> Perhaps I am missing something, but why would you have a thread spun up
> that has nothing to do. If all the child thread is doing is waiting for
> an event from the parent, why not have the parent use a thread from the
> thread pool when a new event occurs that it cares about. Another option
> would be to use an AsynchDelegate ... which may give you some other
> benefits as far as error handling ..etc..
>
> John
>
>
>
> Ram wrote:
> > Hi,
> > I have two threads, one parent thread containing UI and a child
thread
> > waiting for some events from the parent thread. Now, I have two issues:
1)
> > to keep the child thread active till the end of parent thread. 2) Fire
event
> > from the parent thread to child thread.
> >
> > To keep the child thread active, i tried different means including
> > while(1){ application.DoEvents()} but seems that it is not working. I am
> > unable to make it work.
> >
> > For the event, I am able to fire events from the child to parent using
> > delegates, But how to fire it from the parent to child?
> >
> > Thanx
> > Ram
> >
> >
- Next message: phreakstar: "RE: disabling"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: not buffered file reader"
- In reply to: John Murray: "Re: Thread Doubt."
- Next in thread: John Murray: "Re: Thread Doubt."
- Reply: John Murray: "Re: Thread Doubt."
- Reply: Thomas P. Skinner [MVP]: "Re: Thread Doubt."
- Reply: Willy Denoyette [MVP]: "Re: Thread Doubt."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|