Enscribe Programmer's Guide

Figure 17 Using Approximate Positioning With a Queue File
B ssecorPA ssecorP
READUPDATELOCK
Get Record "MB1000"
File is Empty
(request is retained)
Disk process returns record "MA1001"
READUPDATELOCK
WRITE:
Record "MA1001" inserted
File is Empty
(request is retained)
READUPDATELOCK
(request is retained)
WRITE:
Record "AA1002" inserted
This example shows two special actions of the queue file, compared to a standard key-sequenced
file:
The second READUPDATELOCK call retrieved a record whose key was less than that in the
record previously retrieved. This behavior is different than that of an ordinary key-sequenced
file.
The second insertion in the file (key = “AA”) does not cause process A to be awakened,
because the key of the inserted record does not match the selection criteria established by the
KEYPOSITION call.
Generic Positioning
Figure 18 (page 116) illustrates how approximate positioning works for a queue file when the call
to FILE_SETKEY_ (or equivalent call to KEYPOSITION) has these parameters:
key-value = "TA"
comparelength = 2
key-value-len = 2
positioningmode = 1
The queue file has a key length of 10 bytes, so the user key length is 2 bytes.
Accessing Queue Files 115