Also semaphore and event classes are tested in this program. This program contains classical example of consumer-producer task, based on FIFO queue. In First Out order. To run producer you should specify in command line number of messages, which producer should insert in the queue. After insertion of specified number of message producer will terminate.
Consumer is started without no arguments.
It tries to extract message from the queue during some period of time. There is also one utility program for Unix semstat , which extends functionality of ipcs program and allows you to dump semaphore values. Source code of this utility is in semstat.c file. Your are free to use this class in your applications and modify the sources. Freeware status doesn't mean lack of support.