Re: Threading question
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Jul 2005 12:23:03 -0400
John,
See inline:
*What is the meaning of: "implement a method to run each update call in its
own thread"
To me, this would mean that the code that is run on a separate thread is
kept in a single method, and then that method is passed to a Thread
instance, or to the QueueUserWorkItem method on the ThreadPool class.
*If i have a component that does an AsynchronousCallBack that will pass data
to the client, which thread will process the data, the caller or the client
?
The caller thread is the thread that the AsychronousCallBack is called
on (assuming this is just a regular call from another thread, and not a
BackgroundWorker instance).
*How can know which thread is doing that
Is doing what? You mean making callbacks and firing events? Typically,
the thread that is triggering the events is going to be the thread that
event handlers and callbacks are called on.
*If i want to update a user interface it has to be done on the thread that
created the UI. ?
Yes, this is correct.
*If i have a threadpool that call a method on the client (via an interface),
who's thread is doing what ?
This is the same as before, the threadpool thread is firing the events,
so the interface is being called on the thread from the threadpool.
*And how can i do to have a server thread that notify and a client thread
that process so it's not blocking...
You will have blocking on some level if you are waiting for something,
or you will have to poll for the results. Basically, you would have another
thread make a blocking call, and then when the call returns, you can notify
the UI thread.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
.
- References:
- Threading question
- From: John
- Threading question
- Prev by Date: Re: using statement in C#
- Next by Date: Re: Can i Box values in arrays
- Previous by thread: Threading question
- Next by thread: Threading question
- Index(es):
Relevant Pages
|