epoch(9) background information?
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Aug 27 06:52:11 UTC 2018
On 22/08/18 09:09, Matthew Macy wrote:
>>> Yes. Very. It is generally not permitted to hold a mutex across
>>> epoch_wait() that's why there's the special flag EPOCH_LOCKED. If you
>>> have a very limited number of threads, you might want to have each
>>> thread have its own record registered with the epoch. Then you
>>> wouldn't need the CPU pinning. The pinning is just away of providing a
>>> limited number of records to an unbounded number of threads.
>> Thanks for the prompt answer.
>>
>> Do I need a record per thread and per epoch? Could I use only one (maybe
>> dependent on the nest level?) record per thread?
>>
>>
> A record can only be registered with one epoch. And yes you can have just
> one single global epoch. However, then the epoch_wait_preempt time or time
> until the gc task is run is determined be the longest epoch section
> globally.
I think the thread pinning feature is absolutely necessary for an
efficient implementation. You have to avoid any atomic read-modify-write
operations in the fast path. For the preempt variants you have to
maintain a list of threads and for this you need per-processor list heads.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the freebsd-hackers
mailing list