Re: Module suggestion: Atomic operations

2020-07-01 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote in : > C11 has introduced atomic types and atomic operations. When they are not > available, one can use locks/mutexes instead. > > It would be nice if there was a Gnulib module that abstracts over t

Re: Module suggestion: Atomic operations

2020-05-27 Thread Bruno Haible
Hi Marc, > At least one type in is guaranteed to be > lock-free, the atomic flag. Since C18, it can be used in signal > handlers, where Posix locks won't work because they are not > async-safe. Moreover, provides memory fences, which I > don't know how to emulate in general and which also seem t

Re: Module suggestion: Atomic operations

2020-05-25 Thread Marc Nieper-Wißkirchen
Hi Bruno, Am Mo., 25. Mai 2020 um 09:24 Uhr schrieb Bruno Haible : > Pools have the drawback that they add a configuration requirement on the > application: What is the default size of the pool? When to increase the > pool size? By how much? When to shrink the pool? The developer would have > det

Re: Module suggestion: Atomic operations

2020-05-25 Thread Bruno Haible
Hi Marc, > One problem with as given is that atomic values have no > destructors. Thus, we cannot simply attach locks to them in a pre-C11 > implementation because there is no place to destroy the locks. Ah... > Thus, we would have to work with a pool of locks shared by all atomic > variables.

Re: Module suggestion: Atomic operations

2020-05-25 Thread Marc Nieper-Wißkirchen
Hi Bruno, Am So., 24. Mai 2020 um 22:54 Uhr schrieb Bruno Haible : > Yes, given that the platform support for these atomic types/operations is > increasing, it would accelerate the adoption if there was a Gnulib module, > like you describe it. Program developers could then adopt > without losing

Re: Module suggestion: Atomic operations

2020-05-24 Thread Bruno Haible
Hi Marc, > C11 has introduced atomic types and atomic operations. When they are not > available, one can use locks/mutexes instead. > > It would be nice if there was a Gnulib module that abstracts over this, > much like the threadlib module and friends abstract over a specific > threading implem

Module suggestion: Atomic operations

2020-05-24 Thread Marc Nieper-Wißkirchen
C11 has introduced atomic types and atomic operations. When they are not available, one can use locks/mutexes instead. It would be nice if there was a Gnulib module that abstracts over this, much like the threadlib module and friends abstract over a specific threading implementation. What I am t