Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Control Flow of Milter APIs
Multithreading
Chapter 352
Multithreading
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” on page 20 and “The smfi_getpriv() API” on
page 19, respectively.