[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

Using the fork() System Call

During use, some UMS objects allocate system resources, such as file descriptors and X Window colormaps. These objects free those resources whenever the objects are destroyed with somFree().

If you create and use one of those objects before calling the fork() system call, you might create a situation where two objects refer to the same system resource. For example, a UMSXWindow object sometimes, depending upon how it is used, creates new X colormaps. If your application creates and uses a UMSXWindow object and then calls the fork() system call, two UMSXWindow objects now refer to the same X colormap ID. The first of those objects to be freed (using somFree()) also frees the X colormap resource, leaving the other object with a reference to an invalid X colormap.

The best way to avoid this situation is to avoid creating objects that allocate system resources until after you have called fork(). The applicable objects include all file read/write objects such as UMSAVIFileReadWrite and UMSXWindow objects, and objects of classes derived from UMSXWindow such as UMSImageWindow.

For introductory information, see Using Ultimedia Services Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]