Re: light weight user level semaphores

From: Ulrich Drepper (drepper@redhat.com)
Date: Wed Apr 18 2001 - 14:35:47 EST


Linus Torvalds <torvalds@transmeta.com> writes:

Sounds good so far. Some comments.

> - FS_create is responsible for allocating a shared memory region
> at "FS_create()" time.

This is not so great. The POSIX shared semaphores require that an
pthread_mutex_t object placed in a shared memory region can be
initialized to work across process boundaries. I.e., the FS_create
function would actually be FS_init. There is no problem with the
kernel or the helper code at user level allocating more storage (for
the waitlist of whatever) but it must not be necessary for the user to
know about them and place them in share memory themselves.

The situation for non-shared (i.e. intra-process) semaphores are
easier. What I didn't understand is your remark about fork. The
semaphores should be cloned. Unless the shared flag is set there
should be no sharing among processes.

The rest seems OK. Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:28 EST