Query: pserialize_create
OS: netbsd
Section: 9
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PSERIALIZE(9) BSD Kernel Developer's Manual PSERIALIZE(9)NAMEpserialize -- passive serialization mechanismSYNOPSIS#include <sys/pserialize.h> pserialize_t pserialize_create(void); void pserialize_destroy(pserialize_t psz); int pserialize_read_enter(void); void pserialize_read_exit(int s); void pserialize_perform(pserialize_t psz);DESCRIPTIONPassive serialization is a reader / writer synchronisation mechanism designed for lock-less read operations. The read operations may happen from software interrupt at IPL_SOFTCLOCK.FUNCTIONSpserialize_create() Allocate a new synchronisation object. pserialize_destroy() Destroy the synchronisation object. No synchronisation activity should happen at this point. pserialize_read_enter() Enter the critical path of the reader side. Returns an IPL value, which must be passed to pserialize_read_exit(9). Protected code path is not allowed to block. pserialize_read_exit() Exit the critical path of the reader side. Takes the IPL value returned by pserialize_read_enter(9). pserialize_perform() Perform the passive serialization on the writer side. Passing of this function ensures that no readers are in action. Writers must be additionally serialized with a separate mechanism, e.g. mutex(9). Operation blocks and it may only be performed from thread context.EXAMPLESTypical code fragment in the writer side: mutex_enter(&writer_psz_lock); /* * Perform the updates (e.g. remove data items from a list). */ ... pserialize_perform(object->psz); /* * At this point it is safe to destroy old data items. */ mutex_exit(&writer_psz_lock);CODE REFERENCESThe pserialize is implemented within the file sys/kern/subr_pserialize.c.SEE ALSOmembar_ops(3), condvar(9), mutex(9), rwlock(9) Hennessy, et al., Passive serialization in a multitasking environment, US Patent and Trademark Office, US Patent 4809168, February 28, 1989.HISTORYPassive serialization mechanism first appeared in NetBSD 6.0.BSDJuly 30, 2011 BSD
Related Man Pages |
---|
mutex_tryenter(9) - netbsd |
mutex_init(9) - netbsd |
mutex(9) - netbsd |
mutex_destroy(9) - netbsd |
pserialize_destroy(9) - netbsd |