in reply to Re: Why use threads over processes, or why use processes over threads?
in thread Why use threads over processes, or why use processes over threads?
And then there's the real argument: safety. Forked processes default to not sharing; threads default to sharing everything. With the former, you have to explicitly share what you desire to be shared while with the latter you have to explicitly make thread local copies of sensitive data.
Perhaps you haven't actually looked at the docs for threads? To wit:
It is very important to note that variables are not shared between threads, all variables are per default thread local. To use shared variables one must use threads::shared.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Why use threads over processes, or why use processes over threads?
by Aristotle (Chancellor) on Nov 11, 2003 at 19:11 UTC |