tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: POSIX.1 semaphores vs message queues



On Sat, 7 Nov 2015, Joerg Sonnenberger wrote:

On Sat, Nov 07, 2015 at 10:55:49AM +0800, Paul Goyette wrote:
I'd like to understand the rationale that makes POSIX sempahores a
non-optional component of the kernel, while POSIX message queues are
still optional.  Both seem to be related specifically to use in the
librt real-time library.

Semaphores are used quite a lot and not only required by librt, but
also by libpthread. I'm not sure what is using message queues.

Hmmm, sounds like a great reason to include the semaphore code in
every kernel by default.  But it doesn't sound sufficiently critical
to _prevent_ it from being removed from custom kernels if explicitly
requested by the user.

I'd like to suggest that this code once again become an option.  Rather
than adding an option to every kernel configuration file, however, we
can simply add it to src/sys/conf/std where it will get included by
default, in the same manner as MQUEUE.  (I also propose use of "option
SEMAPHORE" rather than P1003_1B_SEMAPHORE, similar to MQUEUE.)

There is nearly zero cost to existing users.  The only changes to any
existing kernels would be an additional line in the INCLUDE_CONFIG_FILE
text for the new line in src/sys/conf/std, and there would be a new file
(and directory) within /stand/<version>/modules/.  Builds would take a
very little bit longer to compile and link the new/resurrected module.



+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+


Home | Main Index | Thread Index | Old Index