VirtualBox

Changeset 25168 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Dec 3, 2009 2:59:20 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: documentation

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/critsect.h

    r25167 r25168  
    44
    55/*
    6  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     6 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4242/** @defgroup grp_rt_critsect       RTCritSect - Critical Sections
    4343 *
    44  * A "critical section" synchronization primitive. This can be used to
    45  * protect a section of code or data to which access must be exclusive.
    46  * Only one thread can hold access to a critical section at one time.
    47  *
    48  * A critical section is a fast write lock; if the critical section is
    49  * not acquired, then entering it is fast (requires no system call).
     44 * "Critical section" synchronization primitives can be used to
     45 * protect a section of code or data to which access must be exclusive;
     46 * only one thread can hold access to a critical section at one time.
     47 *
     48 * A critical section is a fast recursive write lock; if the critical
     49 * section is not acquired, then entering it is fast (requires no system
     50 * call). IPRT uses the Windows terminology here; on other platform, this
     51 * might be called a "futex" or a "fast mutex". As opposed to IPRT
     52 * "fast mutexes" (see @ref grp_rt_sems_fast_mutex ), critical sections
     53 * are recursive.
    5054 *
    5155 * Use RTCritSectInit to initialize a critical section; use RTCritSectEnter
    52  * and RTCritSectLeave to acquire and release access. IPRT uses the Windows
    53  * terminology here; on other platform, this might be called a "futex" or a
    54  * "fast mutex".
    55  *
    56  * If you need a read/write semaphore which allows multiple readers
    57  * but only writer, use RTSEMRW instead.
     56 * and RTCritSectLeave to acquire and release access.
     57 *
     58 * For an overview of all types of synchronization primitives provided
     59 * by IPRT (event, mutex/fast mutex/read-write mutex semaphores), see
     60 * @ref grp_rt_sems .
    5861 *
    5962 * @ingroup grp_rt
  • trunk/include/iprt/semaphore.h

    r21513 r25168  
    3838
    3939/** @defgroup grp_rt_sems    RTSem - Semaphores
     40 *
     41 * This module implements all kinds of event and mutex semaphores; in addition
     42 * to these, IPRT implements "critical sections", which are fast recursive
     43 * mutexes (see @ref grp_rt_critsect ).
     44 *
    4045 * @ingroup grp_rt
    4146 * @{
     
    4449
    4550/** @defgroup grp_rt_sems_event    RTSemEvent - Single Release Event Semaphores
     51 *
     52 * Event semaphores can be used for inter-process communication when
     53 * one thread wants to notify another thread that something happened.
     54 * A thread can block ("wait") on an event semaphore until it is
     55 * signalled by another thread; see RTSemEventCreate, RTSemEventSignal
     56 * and RTSemEventWait.
     57 *
    4658 * @{ */
    4759
     
    166178/** @defgroup grp_rt_sems_mutex     RTMutex - Mutex semaphores.
    167179 *
    168  * @remarks These can be pretty heavy handed. Fast mutexes or critical sections
    169  *          is usually what you need.
     180 * Mutex semaphores protect a section of code or data to which access
     181 * must be exclusive. Only one thread can hold access to a critical
     182 * section at one time. See RTSemMutexCreate, RTSemMutexRequest and
     183 * RTSemMutexRelease.
     184 *
     185 * @remarks These are less efficient than "fast mutexes" and "critical sections",
     186 *          which IPRT implements as well; see @ref grp_rt_sems_fast_mutex and
     187 *          @ref grp_rt_critsect .
    170188 *
    171189 * @{ */
     
    232250
    233251/** @defgroup grp_rt_sems_fast_mutex    RTSemFastMutex - Fast Mutex Semaphores
     252 *
     253 * Fast mutexes work like regular mutexes in that they allow only
     254 * a single thread access to a critical piece of code or data.
     255 * As opposed to mutexes, they require no syscall if the fast mutex
     256 * is not held (like critical sections). Unlike critical sections however,
     257 * they are *not* recursive.
     258 *
    234259 * @{ */
    235260
     
    370395
    371396/** @defgroup grp_rt_sem_rw             RTSemRW - Read / Write Semaphores
     397 *
     398 * Read/write semaphores are a fancier version of mutexes in that they
     399 * grant read access to the protected data to several threads
     400 * at the same time but allow only one writer at a time. This can make
     401 * code scale better at the expense of slightly more overhead in
     402 * mutex management.
     403 *
    372404 * @{ */
    373405
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette