ASSERT_SERIALIZED man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

SERIALIZER(9)		 BSD Kernel Developer's Manual		 SERIALIZER(9)

NAME
     lwkt_serialize_init, lwkt_serialize_enter, lwkt_serialize_adaptive_enter,
     lwkt_serialize_try, lwkt_serialize_exit, lwkt_serialize_handler_enable,
     lwkt_serialize_handler_disable, lwkt_serialize_handler_call,
     lwkt_serialize_handler_try, ASSERT_SERIALIZED ASSERT_NOT_SERIALIZED —
     generic low level serializer

SYNOPSIS
     #include <sys/serialize.h>

     void
     lwkt_serialize_init(lwkt_serialize_t s);

     void
     lwkt_serialize_enter(lwkt_serialize_t s);

     void
     lwkt_serialize_adaptive_enter(lwkt_serialize_t s);

     int
     lwkt_serialize_try(lwkt_serialize_t s);

     void
     lwkt_serialize_exit(lwkt_serialize_t s);

     void
     lwkt_serialize_handler_enable(lwkt_serialize_t s);

     void
     lwkt_serialize_handler_disable(lwkt_serialize_t s);

     void
     lwkt_serialize_handler_call(lwkt_serialize_t s,
	 void (*func)(void *, void *), void *arg, void *frame);

     int
     lwkt_serialize_handler_try(lwkt_serialize_t s,
	 void (*func)(void *, void *), void *arg, void *frame);

     ASSERT_SERIALIZED(s);

     ASSERT_NOT_SERIALIZED(s);

DESCRIPTION
     The serializer API provides a fast locked-bus-cycle-based serialization
     facility that will serialize across blocking conditions.  It is very sim‐
     ilar to a lock but much faster for the common case.

     This API was initially designed to be a replacement for SPL calls, but
     may be used whenever a low level exclusive lock (serialization) and/or
     interrupt/device interaction is required.	Unlike tokens this serializa‐
     tion is not safe from deadlocks nor is it recursive, and care must be
     taken when using it.  Note that tsleep(9) will not release a serializer
     that is being held.

     There are two primary facilities — the serializer facility itself and an
     integrated non-stackable interrupt handler disablement facility used by
     drivers.

     lwkt_serialize_init(), lwkt_serialize_enter() and lwkt_serialize_exit()
     respectively initialize, hold and release the serializer s.
     lwkt_serialize_try() is a non-blocking version of lwkt_serialize_enter().

     lwkt_serialize_adaptive_enter() is a special version of
     lwkt_serialize_enter() which will try to spin a bit before the current
     thread is put to sleep if the serializer s is contended.  By default,
     lwkt_serialize_adaptive_enter() favors spinning over sleeping.  This
     behavior can be changed by tuning the debug.serialize_bolimit and
     debug.serialize_boround sysctl(8) variables.  Note that
     lwkt_serialize_adaptive_enter() is only available in SMP kernels.

     lwkt_serialize_handler_disable(), lwkt_serialize_handler_enable() and
     lwkt_serialize_handler_call() respectively disable, enable and call an
     interrupt handler func for the serializer s.  The arguments arg and frame
     will be passed to the handler.  lwkt_serialize_handler_try() is a non-
     blocking version of lwkt_serialize_handler_call().

     The ASSERT_SERIALIZED() and ASSERT_NOT_SERIALIZED() macros assert that
     the serializer s is being held/not held.

RETURN VALUES
     The lwkt_serialize_try() and lwkt_serialize_handler_try() functions
     return 0 on success and 1 on failure.

FILES
     The serializer itself is implemented in /sys/kern/lwkt_serialize.c.  The
     header file /sys/sys/serialize.h describes the public interface and the
     structure of a serializer.

SEE ALSO
     crit_enter(9), spinlock(9), zsleep(9)

HISTORY
     The serializer API first appeared in DragonFly 1.3.

AUTHORS
     The serializer API was written by Matt Dillon.  This manual page was
     written by Hasso Tepper.

BSD				April 10, 2010				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net