将线程关联到进程 [英] associate thread to process

查看:90
本文介绍了将线程关联到进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。



如果我可以附加一个线程来处理c#中的集合。



谢谢你事先。

hello .

if I can attache a thread to process sets in c#.

thank you in advance.

推荐答案

我认为没有附加线程处理或进程集这样的概念。



您只能在当前进程中创建线程或使用线程池中的线程。在该线程中,除了......强大的进程隔离外,没有什么能阻止您访问其他进程。基本上,强烈建议不要突破这种孤立。尽管如此,原始Windows提供了一些用于访问远程进程内存的API。这种API的使用应限于一些非常特殊的系统实用程序和目的,如调试。在这里,我并不是指外部流程旨在与其他流程协作的情况;请参阅: http://en.wikipedia.org/wiki/Inter-process_communication [ ^ ]。





I don't think there is such concept as "attach a thread to process" or "process sets".

You can only create a thread in your current process or use a thread form a thread pool. In that thread, nothing prevents your from accessing some other process, except… strong process isolation. Basically, breaking through this isolation should be strongly discouraged. Nevertheless, raw Windows provides some API for accessing a memory in remote process. The use of such API should be limited to some very special system utilities and purposes, like debugging. Here, I don't mean the cases when an external process is designed to collaborate with other processes; please see: http://en.wikipedia.org/wiki/Inter-process_communication[^].


会员10210056问:
Member 10210056 asked:

如何在我当前的流程中创建一个线程?

How to create a thread in my current process?

我最近的答案解释了为当前流程获取线程的方法:

如何更改多线程的单线程函数/方法 [ ^ ]。



-SA

The ways to get a thread for a current process are explained in my recent answer:
How to change a Single Thread Function/ Method For Multi Thread[^].

—SA


你的问题没有任何意义。



如果你在谈论c重新创建一个线程并将其从一个进程移动到另一个进程,这是不可能的。
Your question doesn't make any sense.

If you're talking about creating a thread and moving it from one process to another, that's not possible.


这篇关于将线程关联到进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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