Re: clone() and pthreads?

Alan Cox (alan@cymru.net)
Thu, 2 May 1996 23:35:23 +0100 (BST)


> Essentially, the current status of clone() is that the code does work,
> and it's used extensively inside the kernel itself, both for kernel
> threads and for the normal "fork()" system call. As such, it should be
> stable enough to do some real work on.

Ok phase 1. Someone take the basic example and stuff it (forcibly if
need be) into libc5.3.x (I guess 13).

> - file descriptor locking. Currently, if you share file descriptors
> among multiple processes (CLONE_FILES), and one process does a close()
> on a file descriptor while another process is using that descriptor
> for a read(), for example, the kernel can get rather upset.

Ok. So for 2.0 we should avoid CLONE_FILES

> - VM area locking. This is essentially the same as above, except it's a
> case of one process unmapping a vm area while it's being used by
> another process. Again the kernel doesn't test for that, and doesn't
> like it.

This isnt just a clone() issue. truncate can cause this to occur surely.

Alan