叉概念在C# [英] Fork Concept in C#

查看:135
本文介绍了叉概念在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于C#支持线程,有没有什么办法来实现在C#中叉概念?

Since C# supports threading, is there any way to implement fork concept in C#?

在此先感谢....

推荐答案

这是.NET / CLR的更多的问题比C#的。通常,它的底层操作系统的问题。的Windows不支持叉()式的产卵新流程的语义。此外,叉()无关了多线程的支持。

This is more a matter of .NET / CLR than of C#. Generally, it's a matter of the underlying operating system. Windows do not support fork()-like semantics of spawning new processes. Also, fork() has nothing to do with multithreading support.

叉()的语义包括复制原始进程的地址空间中的内容。我的看法是,这是一个过时的方法,进程创建并拥有几乎任何房间在Windows世界,因为它涉及到很多安全和操作系统架构的关注。

The semantics of fork() involves duplicating the contents of the original process's address space. My opinion is this is an obsolete approach to process creation and has barely any room in the Windows world, because it involves a lot of security and operating system architecture concerns.

从观点的.NET点,用的根本问题的fork()将是方法来复制和/或共享非托管资源(文件句柄,同步对象,窗口句柄(!)等)旧的和新的过程之间。我认为没有重大理由提出这样的概念,无论是.NET或底层的Windows操作系统。

From the .NET point of view, the fundamental problem with fork() would be the approach to duplicating and/or sharing unmanaged resources (file handles, synchronization objects, window handles (!), etc.) between the old and the new process. I think there is no serious reason to introduce such concept either to .NET or to the underlying Windows operating system.

如需进一步讨论,请参阅SAURABH的链接。

这篇关于叉概念在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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