IBM AS/400 Manuel D’Utilisation

Page de 489
 
 
RPG Programming in ILE
 
¹
CEEDOD – Decompose Operational Descriptor
Note:  You cannot use these or any other ILE bindable APIs from within a program
created with DFTACTGRP(*YES). This is because bound calls are not
allowed in this type of program.
For more information on these ILE bindable APIs, see Chapter 9, “Running a
Program” on page 103 and also the 
System API Reference.
|
 Multithreaded Applications
|
The AS/400 now supports multithreading. ILE RPG does not directly support initi-
|
ating or managing program threads. However, ILE RPG procedures can run as
|
threads in multithreaded environments. If you want to call an ILE RPG procedure in
|
a multithreaded application, you must ensure that the ILE RPG procedure is
|
threadsafe. You must also ensure that any system functions that your procedure
|
accesses are also threadsafe.
|
The THREAD(*SEREALIZE) control specification keyword can be specified to help
|
you achieve thread safety for an ILE RPG module. Specifying
|
THREAD(*SERIALIZE) will protect most of your variables and all your internal
|
control structures from being accessed improperly by multiple threads. The thread
|
safe module will be locked when a procedure in the module is entered and
|
unlocked when when no procedure in the module is still running. This serialized
|
access, ensures that only one thread is active in any one module, within an acti-
|
vation group, at any one time. However, it is still up to the programmer to handle
|
thread safety for storage that is shared across modules. This is done by adding
|
logic in the application to synchronize access to the storage.
|
For more information, see “Multithreading Considerations” on page 157.
   
Chapter 2. RPG Programming in ILE
21