![]() |
|
#1
|
|||
|
|||
Creating threads in C#Can someone please break down a simple statement for a relative newbie?
C-SHARP / C# Code:
In other words, what is happening at each stage here: C-SHARP / C# Code:
C-SHARP / C# Code:
C-SHARP / C# Code:
Thanks for any help you can give. Last edited by admin : 21-Jul-2009 at 21:13.
Reason: Please insert your example C# codes between [CSHARP] and [/CSHARP] tags
|
|||
|
#2
|
|||
|
|||
Re: Creating threads in C#Sure, I can help =)
C-SHARP / C# Code:
You are creating a thread called firstThread and creating a delegate called Method1(). The ThreadStart instantiation (new ThreadStart(Method1)) is simply saying that when you start executing firstThread, it will jump down to Method1() in your code and start processing what's in that function. This delegate method (here, called Method1()) will be associated with firstThread.... so, when you call firstThread.Start(), the functionality in Method1() will be performed. Now, you must still define and code the Method1() method yourself. I *believe* that it must return a void and take 0 parameters in the parameter list. So here is what your code could look like: C-SHARP / C# Code:
Last edited by admin : 21-Jul-2009 at 21:12.
Reason: Please insert your example C# codes between [CSHARP] and [/CSHARP] tags
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error compiling Apache 2.2.10 | tiagofgarcia | Apache Web Server Forum | 2 | 10-Nov-2009 14:31 |
| SIGTERM to main process does not kill detached threads!! :( | deepti_v | C++ Forum | 0 | 31-Jul-2008 05:31 |
| Thread synchronization Assignment help!! | rossi143 | C Programming Language | 1 | 25-Mar-2007 21:10 |
| user level threads in C | beuh | Miscellaneous Programming Forum | 2 | 17-Oct-2006 06:44 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 07:19 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The