Reference to a Thread.

  • Thread starter Thread starter Anibal
  • Start date Start date
A

Anibal

Hi,
How can i do to mae a reference to a particular running thread in a given
time.
For example, supose that i define ans start 3 diferents threads, and what i
want is in a given moment create a thread variable and set it to one of
those threads and for example abort it, if it is running, but i want to have
the freedom to make the reference variable from any part of my code at any
time, for example 'Thread.CurrentThread' it doesn't suite me.

Thanks you very much.
 
Like all software, exposure dictates where you can see something from. If you
want to use code throughout your app, you will have to make it global. One of
the easiest ways to set up your own thread control mechanism is to pin the
references to a singleton and use it to poke at the individual threads.

Be very careful when you fire off at threads throughout your app, as you can
easily create code that is not thread safe.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Thanks for your replay,
I do use global thread variables, thats the only way i've found, what i was
looking for is something like a shared collection or array in the .Net
Framework wich allows me to get trace of every thread within an application,
or something like that.
Thank you.


"Cowboy (Gregory A. Beamer) - MVP" <[email protected]>
escribió en el mensaje
 
Back
Top