是否可以在C#中迁移线程? [英] Is it possible to migrate thread in C#?

查看:95
本文介绍了是否可以在C#中迁移线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好每个人......



我想开始在一台PC上运行一个线程然后中断它并捕获它的堆栈帧并发送它到其他PC继续运行......是否有可能???



Plz试着帮助我,我没时间......

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...

推荐答案

不可能。



执行此操作的唯一方法是启动线程,但稍后中断它,让它停止并导出其数据以便可以序列化并发送到另一台机器。



另一台机器必须反序列化数据,在线程中旋转完全相同的代码,将数据移交给新线程让它恢复计算。



当然,这取决于包含足够的计算状态信息的数据,以便可以随意停止和恢复。
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.


有两个选项,一个是告诉线程保存数据,以便另一个线程可以从该点继续。然后线程退出,数据被发送到另一台使用这些数据启动进程的计算机。



另一个选项是让线程每次都保存数据经常。然后使用该数据启动并启动新线程。





区别在于一个是命令,线程崩溃或丢失,然后就没有办法继续。另一个允许一定量的恢复。这种东西不是特定于线程,而是任何可以包含多个线程的程序。第二种方法是提供容错功能。
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.


这篇关于是否可以在C#中迁移线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆