~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/barriers.rst

  • Committer: Monty Taylor
  • Date: 2011-03-10 19:13:42 UTC
  • mfrom: (2227.1.5 build)
  • Revision ID: mordred@inaugust.com-20110310191342-zgf5yjtm2e1l2tqq
Merge Olaf: Refactoring Work
Merge Brian: Replication bug fixes
Merge Marisa and Mark: Documentation fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
  SELECT signal();
15
15
 
16
 
A barrier is a synchronization object which can be used to synchronize a group of sessions to a specific rendezvous by calling wait(). When wait() is called, any session of the user may call signal(), allowing all sessions being held by wait() to proceed.
17
 
 
18
 
Barriers can optionally be created with a limit so that once a set number of sessions have called wait() that all "waiters" are then allowed to proceed. 
19
 
 
20
 
The session that creates the barrier via create_barrier() is not allowed to call either wait() or wait_until().
 
16
A barrier is a synchronization object which can be used to synchronize
 
17
a group of sessions to a specific rendezvous by calling wait(). When
 
18
wait() is called, any session of the user may call signal(), allowing
 
19
all sessions being held by wait() to proceed.
 
20
 
 
21
Barriers can optionally be created with a limit so that once a set
 
22
number of sessions have called wait() that all "waiters" are then
 
23
allowed to proceed.
 
24
 
 
25
The session that creates the barrier via create_barrier() is not
 
26
allowed to call either wait() or wait_until().
21
27
 
22
28
The scope of barriers is to the given username.
23
29
 
24
 
Beyond waiters, you can also create observers by using the wait_until() function. Observers are released not only when signal() or release_barrier() is called, but also when their definitive predicate happens. You can use wait_until() to have a session wait for a certain number of waiters to occur, and then do some body of work before the waiters() are signaled to continue.
 
30
Beyond waiters, you can also create observers by using the
 
31
wait_until() function. Observers are released not only when signal()
 
32
or release_barrier() is called, but also when their definitive
 
33
predicate happens. You can use wait_until() to have a session wait for
 
34
a certain number of waiters to occur, and then do some body of work
 
35
before the waiters() are signaled to continue.
25
36
 
26
 
All waiters and observers are released if release_barrier() is called by the session which created the barrier. Also, if the session that created the barrier disconnects, all waiters and observers are notified.
 
37
All waiters and observers are released if release_barrier() is called
 
38
by the session which created the barrier. Also, if the session that
 
39
created the barrier disconnects, all waiters and observers are
 
40
notified.
27
41
 
28
42
Information on all barriers can be found in the DATA_DICTIONARY.USER_BARRIERS table.
29
43