Threading Question

  • Thread starter Thread starter graeme g
  • Start date Start date
G

graeme g

hi

how do i start a thread but give it parameters...

i.e.

say i want to resolve a whole bunch of ip addresses

how do i give the thread the ip address without having to put the
addresses in a list then have the thread get it from there

thanks
graeme
 
Graeme,

You can create a class that you pass the addresses to (and any other
information it needs), and then expose a method on that class which you pass
to the ThreadStart delegate.

In .NET 2.0, there is a ParameterizedThreadStart delegate which you can
pass to the Thread now, and pass a parameter to it.

Hope this helps.
 
Back
Top