[Tarantool-patches] [PATCH v3] wal: introduce limits on simultaneous writes
kostja.osipov at gmail.com
Tue Mar 2 00:46:38 MSK 2021
* Serge Petrenko <sergepetrenko at tarantool.org> [21/03/01 22:19]:
> 25.02.2021 16:05, Konstantin Osipov пишет:
> > * Serge Petrenko via Tarantool-patches <tarantool-patches at dev.tarantool.org> [21/02/24 22:39]:
> Hi! Thanks for the review!
> > Looks like a simple counting semaphore. I don't see why it has
> > to be specific to class journal, more like part of lib/core.
> > https://en.cppreference.com/w/cpp/thread/counting_semaphore
> Not completely. It has 2 limits instead of 1, size and len,
> and the limits are 'soft', meaning the resource is free at the
> moment we wake the waiters up but it may be occupied again once
> the waiters actually wake up.
For problem 1, use two semaphores, if you need two limits. For
problem 2, I don't see any value in doing it this way. Do you?
> Some fibers put to execution before
> the waken ones may have exhausted the limit, but we don't care
> about that.
Then they don't take the semaphore?
> IMO this looks quite specialised. And there wouldn't be much use
> of such a primitive in lib/core.
There is inherent value to solve the problem using standard
primitives. Non-standard primitives should be justified over
standard ones, not vice versa.
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches