[OT] poll() vs. AIO

Bernd Petrovitsch bernd at petrovitsch.priv.at
Sat Aug 20 16:06:04 UTC 2011


On Sam, 2011-08-20 at 10:00 -0400, Rich Felker wrote:
> On Sat, Aug 20, 2011 at 01:37:23AM +0200, Bernd Petrovitsch wrote:
> > > Multiprocessing can accomplish *some* of the same things, but not all,
[....]
> > > Note that just using threads does not commit you to making heavy use
> > > of memory sharing. You can still write your code very similar to how
> > 
> > Ooops, threads share the whole (virtual) memory by design.
> 
> That does not mean you have to use it at all. It's completely possible
> to write a multi-threaded program where each thread never accesses any
> object except its own automatic variables and memory it allocated
> itself with malloc. The only cases I can think of where memory virtual

... and free()d at some time.
Of course it is possible. But (all of) the (current and future)
programmer(s) have to think of that and - and that's the main problem -
if someone violates that rule, it can't be detected immediately
automatically.
When it is detected (months later?!), you have a problem. Fixing it in
environments with daadlines for projects is an organizational
challenge ....
BTW you obviously never worked with (the source of) e.g.
Asterisk-2.2/2.4 ....

BTW if a thread uses only automatic variables (and self-malloc()ed
etc.), if can also use fork() - which is quite cheap - equivalently and
loose all of the above risks.

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at



More information about the busybox mailing list