Common multithreaded programming errors
Several programming errors often occur when you write multithreaded applications.
- Calling functions that are not threadsafe
When you write a threaded application, the most common programming error is the use of APIs or system services that are not threadsafe. - Thread creation not allowed failure
Not all jobs in the IBM i operating system are allowed to create threads. - Ending of activation group
The IBM i Integrated Language Environment® (ILE) program model uses activation groups as a way to encapsulate resources for an application program within a job. - Mixing thread models
Do not mix Pthreads APIs with other thread management APIs that might be provided by the system. It might cause unpredictable results. - Commit operations in multithreaded programs
Database transactions in the IBM i operating system are scoped to the job or the activation group. - Database record I/O and thread safety
The I/O feedback area of a database file can be used to communicate results of I/O operations to the record I/O user. A typical application might have problems with thread safety because of the nature of the feedback area.
Parent topic: Multithreaded programming techniques
Related concepts:
Related information: