Communications considerations for multithreaded programming
The only threadsafe communications protocol supported on the IBM® i operating system is sockets.
The use of sockets is subject to the following restrictions:
- Socket APIs:
The majority of the sockets interfaces are threadsafe, but most of the network routines are not due to the use of static storage. These routines have been replaced with threadsafe _r counterparts. For example, you should replace calls to gethostbyaddr() with gethostbyaddr_r(). The _r routines are compatible with the UNIX definition. All _r functions reside in the existing service program QSOSRV2.
- AnyNet® using
sockets:
AnyNet using sockets is considered threadsafe and is supported in multithread programs. However, this support has not undergone any formal testing.