Open System Services Programmer's Guide
Table 72 Thread-Aware Enscribe Functions (continued)
DescriptionFunction
Writes data to a process previously opened from an array and waits for data to
be transferred back from the process
PUT_FILE_WRITEREAD_
1
Returns data from an open file to the application process data areaPUT_READX
Reads data from a disk or process file in anticipation of a subsequent write to the
file
PUT_READUPDATEX
Sequentially locks and reads records in a disk filePUT_READLOCKX
Locks, then reads the record from the current position in the file in anticipation of
a subsequent call to PUT_WRITEUPDATEX or PUT_WRITEUPDATEUNLOCKX
PUT_READUPDATELOCKX
Initiates the dialog and sends the first message of the dialog to the server instance
in the Pathway serverclass (larger message version)
PUT_SERVERCLASS_DIALOG_BEGINL_
1
Initiates a send within the specified dialog to the server instance in the Pathway
serverclass
PUT_SERVERCLASS_DIALOG_SENDL_
1
Sets device-dependent functionsPUT_SETMODE
Writes data to a file from an array in the application, then waits for data to be
transferred back from the file
PUT_WRITEREADX
Writes data from an array in the application to an open filePUT_WRITEX
Transfers data from an array in the application to a filePUT_WRITEUPDATEX
Performs random processing of records in a disk filePUT_WRITEUPDATEUNLOCKX
Excludes other users from accessing a filePUT_LOCKFILE
Unlocks a disk file and any records in that file currently locked by the userPUT_UNLOCKFILE
Excludes other users from accessing a record at the current positionPUT_LOCKREC
Unlocks a record currently locked by the userPUT_UNLOCKREC
1
Beginning with the H06.24 and J06.13 RVUs.
Using Thread-Aware Enscribe Functions
Example 102 (page 422) shows an example of using the thread-aware PUT_FILE_OPEN_. This
function blocks the calling thread instead of the calling process.
Compilation:
/usr/bin/c89 -Wextensions -Wsystype=oss -c ens_thread.c -o ens_thread.o
nld /usr/lib/crtlmain.o ens_thread.o libspt.a -obey /usr/lib/libc.obey
-lzcplsrl -o ens_thread
Output:
Hello, I am in Thread1
Calling PUT_FILE_OPEN_ - thread-blocking Enscribe call
Hello, I am Thread2
error returned in open : 0 filenum : 6
error in file close 0
In contrast, if you replace the calls to the thread-blocking PUT_FILE_OPEN_ function with calls
to the process-blocking FILE_OPEN_ function, and change the my_printf() statement
accordingly, the program results in the following output:
Hello, I am in Thread1
Calling FILE_OPEN_ - process-blocking Enscribe call
error returned in open : 0 filenum : 6
error in file close 0
Hello, I am Thread2
Thread-Aware Enscribe Functions 421