I have two questions:
1.) What is the difference between a proccess and a thread?
2.) Does windows support proccess, or is it only working with threads?
Thanks.
I have two questions:
1.) What is the difference between a proccess and a thread?
2.) Does windows support proccess, or is it only working with threads?
Thanks.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Think of a process as a program. Think of a thread as a subpart of a program.
Although that description is not exact, it helps you get the gist of the difference.
Basically, processes can stand alone while threads cannot. Windows supports both.
is there a way then to do something like the fork() in unix, only on windows?
also, I know when you place some code as part of a child proccess, it runs next to the parent proccess and not as part of it. is that the same with threads?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
You use threads in Windows to simulate fork() functionality from Unix.
When a thread creates anothter thread, both threads are part of the same address space (process).
gg
Windows supports processes, threads and fibers, which are like manually scheduled threads.
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
fork() creates a copy of a process, not a thread as such. It's functionality can, indeed, be simulated, but it is not the same.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
No one is claiming they are the same. Since you can't clone a process in Win32, the only way to simulate it is with threads.
gg
so... can I make a piece of code to run on it's own, next to the other code?
look, i have the next thing:
I have some code running.
in the middle of that code i have a long loop.
and then the code continues.
what i want to do is to place this long loop in such a way so it won't hold the rest of the code back, so i won't need to wait for the loop to finish, before i continue.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Thank you for all your help.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.