Re: [patch 7/8] fdmap v2 - implement sys_socket2

From: Alan Cox
Date: Sun Jun 10 2007 - 11:12:52 EST


> > and there's absolutely nothing wrong with this kind of setup, even if you
> > could obviously have done it other ways too (ie by using "dup2()" instead
> > of "close + open"),
> >
>
> This kind of setup was OK 25 years ago, before multithreading era.
> You cannot reasonably expect it to work in a multithreaded program.

Why not.

When execution begins which is the normal point you do this then you've
got one thread. If you need to do this from a thread after that point
posix provides threaded applications with locking.

Not much else works in a threaded app if you get the locking wrong, and
that is considered the authors job. Why is fd allocation different ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/