Sem is an OCaml module implementing support of POSIX semaphores. The package contains code in C and OCaml programming languages. Once compiled it makes a usual OCaml library usable in both byte-code and native code development.
The initial goal of "ocaml-sem" project was to make a library which could be used by an OCaml programmer to operate with OS's POSIX semaphores. Since Google returned no result, I've decided to write my own code implementing a features the task could require.
The library implements an interface between OS POSIX semaphore API and OCaml-based application. The library is well self-documented since it builds the set of HTML documentation in traditional OCaml ocamldoc style.
Using this library a programmer can easily construct code creating, accessing and destroying POSIX semaphores. The set of semaphore operations contain all basic functions I've found in FreeBSD "sem" API:
More documentation on the library's interface and implementation can be found in the code which is well commented and documented according to basic OCaml documentation tradition.
This is OCaml "Sem
" library. It is intended to be a first (AFAIK) try to
implement POSIX semaphores in OCaml.
Further documentation on library installation and usage you may find in INSTALL and sem.mli files.
The library was made following the pattern of POSIX semaphore infrastructure of FreeBSD.
Since it's an early alpha you are welcome to change it or suggest new ideas in order to make it usable on any platform of your fantasy ;).
DONE:
sem*
calls using a handle of a closed semaphore (after Sem.sem_close
) lead
to a core dump (signals either 6 or 11) as tested on FreeBSD-5. This issue
has its roots somewhere deeply inside libc or kernel, I dunno as for now.
To build this package you should have:
$ make all $ make install
Additionally, you may
make docs.
Copyright (c) 2005, Paul Argentoff <argentoff at gmail.com> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
OCamlMakefile is a part of ocaml-make package by Markus Mottl; it is made under GNU LGPL and can be freely found at http://www.oefai.at/~markus
Index of types
Index of values
Index of modules
© Paul Argentoff, 2005