Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Good morning every body...

I'd like to start running a thread on one PC then interrupt it and capture its stack frame and send it to other PC to continue running... Is it possible???

Plz try to help me I don't have time...
Posted
Comments
Sergey Alexandrovich Kryukov 2-May-13 19:04pm    
This is not possible or impossible, this is... illiterate, sound like a misuse of the notion of "thread". This is not data or something, in cannot be "sent" (copied, read, saved, loaded) anywhere. Just tell us what would you like to achieve ultimately, and why.
—SA
N_Farraj 2-May-13 19:14pm    
I'm so happy for your immediate reply

Its a course project.

Doctor asked me to show my classmates how I can transfer a thread to work on other PC.

He asked me to create two 2D-array of numbers and calculate there product by sending a column and a row as a parameters to thread and then send this thread to another PC to calculate the result, and send it back to the first PC...
[no name] 2-May-13 19:18pm    
No you would not send the thread, you would send the data.
N_Farraj 2-May-13 19:20pm    
:'(

What should I do now
[no name] 2-May-13 19:26pm    
Whatever you want. It's your project. Except you can't do something that is impossible like sending a thread to another computer.

Not possible.

The only way to do this would be to start the thread, but then some time later interrupt it, have it stop and export its data so that it can be serialized and sent to another machine.

The other machine would have to deserialize the data, spin up the exact same code in a thread, hand over the data to the new thread and have it resume the calculation.

This, of course, is dependent on the data containing enough state information on the calculation so that it can be stopped and resumed at will.
 
Share this answer
 
v2
There are two options, one is that you tell the thread to save the data so that another thread can proceed from that point. Then the thread exits, and the data is sent to another computer where a process is started using this data.

The other option is for the thread to save data every so often. Then take that and start and new thread using that data.


The difference is that one is commanded, so is the thread crashes, or is lost, then there is no way to continue. The other allows for a certain amount of recovery. This sort of stuff is not specific to threads, but any program, which can contain multiple threads. The second would be a way to provide fault tolerance.
 
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