HPlogo Sendmail 8.13.3 Programmer's Guide: HP-UX 11i v1 and HP-UX 11i v2 > Chapter 3 Control Flow of Milter APIs

Multithreading

» 

Technical documentation

Complete book in PDF

 » Table of Contents

A single filter process can handle any number of connections simultaneously. All the filtering callbacks must therefore be reentrant and they must use appropriate external synchronization methods to access global data. Because a one-to-one correspondence between the threads and connections (N connections mapped on to M threads, where M is less than or equal to N) does not exist, you must access connection-specific data through the handles provided by the Milter library. You must not rely on the thread-specific data blocks supplied by the library to store data blocks (for example, pthread_getspecific()) to store connection-specific data.

For more information on setting and getting connection-specific pointers, see “The smfi_setpriv() API” and “The smfi_getpriv() API”, respectively.