Click here to Skip to main content
16,004,887 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Let say I have windows form with button. And for each click new thread is created. Thread is isolated peace of memory. So, when the form is loaded, the form object is created in the main thread. Now, when the button is pressed - new thread is created. This means that new isolated memory area is allocated for this thread.
My question is: does this new thread will also contain form object or will contain reference to the form? If yes, so how, OS knows that when new thread is created it has to created in it form object. If I'm wrong, so what is created in the new thread?

I hope, I explained correctly my question.

Thank you very much
Posted
Comments
CPallini 28-Sep-10 3:57am    
Threads are NOT 'isolated pieces of memory' please read some tutorial about threading.

You could have this Multi Threading article to be useful.

http://www.yoda.arachsys.com/csharp/threads[^]

Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
TheAteist 28-Sep-10 4:51am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
So, all threads that are created will share the form object, right? Each thread will only be responsible for different functions to execute.

Am I right?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900