Re: passing parameter to thread ??

From: Richard Blewett [DevelopMentor] (richardb_at_develop.com)
Date: 09/27/04


To: microsoft.public.dotnet.languages.csharp
Date: Mon, 27 Sep 2004 04:47:37 -0700

Diving in before Jon does ;-)

 http://www.yoda.arachsys.com/csharp/threadstart.html

 Regards

 Richard Blewett - DevelopMentor
 http://staff.develop.com/richardb/weblog

   nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<#Wo6xVIpEHA.1644@tk2msftngp13.phx.gbl>

 Hi,
 
 Is there a way to pass a parameter to a thread ?
 
 Creating a thread is done using a ThreadStart-delegate object
 
 example :
 Thread thread1 = new Thread(new ThreadStart(MyFunction))
 
 Unfortunately, it doesn't allow me to pass arguments to MyFunction since the definition of the ThreadStart is :
 public delegate void ThreadStart();
 
 Is there a way, anyhow, to pass a parameter to a thread ?
 Using some other mechanism ?
 
 thnx
 Christian
 
 **********************************************************************
 Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
 Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.768 / Virus Database: 515 - Release Date: 22/09/2004

 
 [microsoft.public.dotnet.languages.csharp]



Relevant Pages

  • Re: Hi
    ... Regards ... Richard Blewett - DevelopMentor ... Checked by AVG anti-virus system. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Combo box refresh
    ... >> Richard Blewett - DevelopMentor ... In PopulateDatasetList how is this populating the combobox? ... Regards ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Strong name trouble
    ... > Richard Blewett - DevelopMentor ... >> My code DOES NOT WORK if assemblies ARE strong name. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Messagebox.Show refresh
    ... Regards ... > Richard Blewett - DevelopMentor ... > In a C# application I use a message box to display an error. ...
    (microsoft.public.dotnet.framework)
  • Problem in using Assembly CreateInstance
    ... Is ManWrapper in a namespace? ... Regards ... Richard Blewett - DevelopMentor ...
    (microsoft.public.dotnet.languages.csharp)