ATMI C Function Reference
tpsprio()
—Sets the service request priority.
#include <atmi.h>
int tpsprio(prio, flags)
tpsprio()
sets the priority for the next request sent or forwarded by the current thread in the current context. The priority set affects only the next request sent. Priority can also be set for messages enqueued or dequeued by tpenqueue()
or tpdequeue()
, if the queued message facility is installed. By default, the setting of prio
increments or decrements a service's default priority up to a maximum of 100 or down to a minimum of 1, depending on its sign, where 100 is the highest priority. The default priority for a request is determined by the service to which the request is being sent. This default may be specified administratively (see UBBCONFIG(5)), or take the system default of 50. tpsprio()
has no effect on messages sent via tpconnect()
or tpsend()
.
A lower priority message does not remain enqueued forever because every tenth message is retrieved on a "first in, first out" (FIFO) basis. Response time should not be a concern of the lower priority interface or service.
In a multithreaded application tpsprio()
operates on a per-thread basis.
The following is a list of valid flags:
In a multithreaded application, a thread in the TPINVALIDCONTEXT
state is not allowed to issue a call to tpsprio()
.
Upon failure, tpsprio()
returns -1 and sets tperrno
to indicate the error condition.
Upon failure, tpsprio()
sets tperrno
to one of the following values:
tpacall(3c)
, tpcall(3c)
,tpdequeue(3c)
, tpenqueue(3c)
, tpgprio(3c)