Spinlocks and Critical Sections

A spinlock waits in a busy loop, repeatedly checking until a lock becomes available.

The system then holds the lock until you explicitly release it by calling a function.

Critical sections allow your code to prevent a lock on a control CPU from causing excess latency to a data CPU thread. Your code does this by deferring context switches during execution of a portion of code called a "critical section" that holds a lock that could be contended across data and control CPUs.

The APIs are at sandbox/src/juniper/lib/libmp-sdk/h/jnx/msp_locks.h and sandbox/src/juniper/lib/libmp-sdk/h/jnx/msp_ucrit.h, and are documented in the API reference. For sample code, see the programming task, Working with Spinlocks and User-Level Critical Sections.

IP Socket-Based Inter-Process Communication


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5