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.
Printable View
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.
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?
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.
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.
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.
Thank you for all your help.