Click here to Skip to main content
15,910,009 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hello .

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

thank you in advance.
Posted
Comments
ridoy 20-Aug-13 15:17pm    
not understandable actually what you are talking about.Please add some description by Improve question button.
Sergey Alexandrovich Kryukov 20-Aug-13 18:02pm    
For your information, there are two answers already...
—SA

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[^].

[EDIT]
Member 10210056 asked:
How to create a thread in my current process?
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
 
Share this answer
 
v2
Comments
Member 10210056 21-Aug-13 5:35am    
how to create a thread in my current process ?
because when i create a new thread it associate to the process System not in a current process
Sergey Alexandrovich Kryukov 21-Aug-13 9:53am    
Please see updated answer, after [EDIT]. I have no idea how could you manage to create a thread associated to any other process. You know what? I strongly suspect this is your fantasy. However, if you really did it, please explain how — I would really like to know.
—SA
Dave Kreskowiak 21-Aug-13 10:24am    
No, you didn't. You created a thread in your own process. It's running as the user who launched the process, not as System.

I really think you need to explain how you created this thread (show the code!) and why you think it's being created as System an how you're testing this condition.
Sergey Alexandrovich Kryukov 21-Aug-13 10:33am    
Exactly...
—SA
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.
 
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