Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
A
B
C
D
E
F
G
H
I
JK
L
M
N
O
P
QR
S
T
UV
WXYZ+
Get a full dump of the dictionary:
List of Names
Short Form
Full Form
// This program implements a fifo that can be used to send // data between two threads. (From the Pike 0.6 manual, sec 10) inherit Thread.Condition : r_cond; inherit Thread.Condition: w_cond; inherit Thread.Mutex: lock; mixed *buffer = allocate(128); int r_ptr, w_ptr; int query_messages() { return w_ptr - r_ptr; } // This function reads one mixed value from the fifo. // If no values are available it blocks until a write has been done. mixed read() { mixed tmp; object key=lock::lock(); while(!query_messages()) r_cond::wait(key); tmp=buffer[r_ptr % sizeof(buffer)]; w_cond::signal(); return tmp; } // This function pushes one mixed value on the fifo. // If the fifo is full it blocks until a value has been read. void write(mixed v) { object key=lock::lock(); while(query_messages() == sizeof(buffer)) w_cond::wait(key); buffer[w_ptr % sizeof(buffer)]=v; r_cond::signal(); }
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some examples copyright of their respective authors. Some technologies and languages are trademarked. Permission to copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome. Please use email, the address is ziring@home.com
[Ziring MicroWeb Home] [Dictionary Start] [Sign Guestbook]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent additions to dictionary and master list, 1/00.