Re: Passing parameters to a thread
From: Sriram Krishnan (ksriram_at_NOSPAMgmx.net)
Date: 10/14/04
- Next message: Serge Lobko-Lobanovsky: "System.OutOfMemory exception: error creating window handle"
- Previous message: Sebastien Girard: "Re: AppDomain.CreateInstanceAndUnwrap of shared (GAC) assemblies"
- In reply to: Arno: "Passing parameters to a thread"
- Next in thread: Haim: "RE: Passing parameters to a thread"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 18:50:59 +0530
You have 2 options.
1. Use the ThreadPool and the WaitCallback delegate
2. Use .NET 2.0 and use the ParameterizedThreadStart i.e if you have the
option of using .NET 2.0
Sriram Krishnan
http://www.dotnetjunkies.com/weblog/sriram
"Arno" <Arno@discussions.microsoft.com> wrote in message
news:8A71B593-4BF4-49E6-B9BA-C65B5B770759@microsoft.com...
> Hi,
>
> I'm running into a thread problem. The context is a distributed
> application
> constituted of a controller and several satellites performing a given job.
>
> In the controller application, I have to send command requests over the
> network to a list of satellites. In order to parallelize request sending,
> I'd
> like to have each request (one per satellite) sent by a single Thread. The
> problem is how would a given thread know which satellite he should be
> taking
> care of since it seems like I can't pass parameters to a thread.
>
> My threads can have access to the list (a Hashtable actually) of
> satellites,
> but how would a given thread know exactly which one it should be taking
> care
> of ? I would need, at least, to pass an index to each thread...
>
> Any idea or comment is welcome.
> Thanks in advance.
> Arno
- Next message: Serge Lobko-Lobanovsky: "System.OutOfMemory exception: error creating window handle"
- Previous message: Sebastien Girard: "Re: AppDomain.CreateInstanceAndUnwrap of shared (GAC) assemblies"
- In reply to: Arno: "Passing parameters to a thread"
- Next in thread: Haim: "RE: Passing parameters to a thread"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|