Re: Events and threads ... whose thread am I on anyway?
- From: "DaTurk" <mmagdits@xxxxxxxxxxx>
- Date: 29 Jan 2007 08:50:36 -0800
This class was designed specifically to stay away from TP threads. SO
we can just create a single worker thread that handles the task
alotted for it.
On Jan 29, 10:33 am, "William Stacey [C# MVP]"
<william.sta...@xxxxxxxxx> wrote:
Also note, some events "may" be raised using a TP thread if the class
designer invoked the handlers that way. This is something you may also need
to do yourself under some cases (i.e. invoke them manually).
--
William Stacey [C# MVP]
PCR concurrency library:www.codeplex.com/pcr
"DaTurk" <mmagd...@xxxxxxxxxxx> wrote in messagenews:1170085276.062832.248290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Here's a quick question, say I have a class with a main routine, we'll
| just call it main.
|
| Main is on the "main" thread.
|
| Now lets have main creat an instance of another class, which creates a
| thread, and has it do some
| calculation, and on completion calls an event which main has += on.
| Lets call this class, calcClass.
|
| CalcClass is on the "calc" thread. "<I'm just making these statements
| to confirm we have two threads>
|
| OK, so we have main += on calcClass's event, and sending it to do it's
| thing. So here's the question, Events are called synchronously by
| default right, unless you use begin invoke or something. So, when an
| event gets popped from calcClass, and we enter the eventhandling code
| in main, we will be on calcClass's thread? Is this correct?
|
.
- Follow-Ups:
- Re: Events and threads ... whose thread am I on anyway?
- From: joachim@xxxxxxxxxxxxxxxxxxx
- Re: Events and threads ... whose thread am I on anyway?
- References:
- Events and threads ... whose thread am I on anyway?
- From: DaTurk
- Re: Events and threads ... whose thread am I on anyway?
- From: William Stacey [C# MVP]
- Events and threads ... whose thread am I on anyway?
- Prev by Date: Re: Slicing Routine!
- Next by Date: Re: Red progressbar on Vista.
- Previous by thread: Re: Events and threads ... whose thread am I on anyway?
- Next by thread: Re: Events and threads ... whose thread am I on anyway?
- Index(es):
Relevant Pages
|