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

Re: sem_open is coming!



Jeffrey Walton, le mer. 16 déc. 2020 18:55:53 -0500, a ecrit:
> On Wed, Dec 16, 2020 at 6:02 PM Samuel Thibault <sthibault@debian.org> wrote:
> > More and more packages were depending on a working sem_open() function
> > (scipy, pandas, matplotlib, etc.) so I "implemented" it (basically
> > copied over the nptl implementation), it will be in libc0.3 2.31-6 which
> > is getting built.
> 
> Forgive my ignorance... I thought semaphores were counted signals
> implemented by the OS so they can be used across processes.

If you implement them in the OS only they would be performing very
poorly. You don't want to pay the user/kernel switch cost at each
sem_wait/post operation. The OS does provide the basic feature for
"blocking", indeed, read the "futexes are tricky" paper from Ulrich
Drepper for more information.

> I don't believe libc should be in the business of sharing data across processes.

Your mileage may vary.

Not providing the feature means excluding the availability of
applications currently requiring it.

> Processes should not be sharing data like that because a corruption in
> one process affects another process.

Sharing data is a complex matter, indeed. That doesn't mean we shall not
implement support for it.

Samuel


Reply to: