Click here to Skip to main content
15,888,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm weak in threading and each and every sites doesn't explain it in good way. They just explain basic threading way and i.e calling a function through thread without any return type and parameters of the function.
If I want to pass a function in thread which contains both return type as well as parameter then how to call that function.
And also plz tell If the calling function contains a function coming from another class then how to utilize it
Posted

1 solution

A big confusion is sometimes made about threading if you focus on it as a simple function to call. The real scope of threading is to have parallel execution of tasks working concurrently.
You have to look at threading as starting a completely new program that share same process memory, so each objects and memory address are valid for all execution threads.
Using the correct point of view also organization of your design can be much more efficient.
For a general description look here.
For a specific solution on parameters passing see.
About returning a value read this.
Btw looking correctly at threading make these elements secondary, with correct design they are not so usefull.
 
Share this answer
 
Comments
binadi007 8-Feb-15 13:53pm    
Thanks It's really a good with appropriate 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