[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
AX_WorkerThreadActivity()
Returns information about worker threads that are currently processing an
operation on the Advantage Database Server
------------------------------------------------------------------------------
Syntax
AX_WorkerThreadActivity() -> array
Returns
Returns a two dimensional array of information about Advantage Database
Server worker threads that are currently processing an operation. The
length of the first dimension of the returned 2-D array will be equal to
the number of active worker threads. The second dimension of the
returned 2-D array has four elements containing:
[n][1] = (numeric) Worker thread number
[n][2] = (numeric) Advantage operation code
[n][3] = (string) Name of the user who requested the operation
[n][4] = (numeric) NetWare connection number of user who requested the
operation
- or -
Returns an empty array if an error occurred or no worker threads are
active on the Advantage Database Server. If an error occurred,
AX_Error() will return information on why the function failed.
Description
AX_WorkerThreadActivity() returns a two dimensional array of information
about worker threads that are currently processing an operation on the
Advantage Database Server. Examples of Advantage operations include
skip, seek, build index, and open table. Most Advantage operations take
almost no time at all to complete on the Advantage Database Server. A
few operations, such as build index, may take more than a few
milliseconds to complete. Since most Advantage operations take a very
short time to complete, the result of an AX_WorkerThreadActivity() call
will often indicate that no worker threads (other than the worker thread
currently processing this AX_WorkerThreadActivity() operation) are busy.
It is possible that the number of elements in the second dimension of
the returned 2-D array with worker thread information will increase in
future releases of Advantage. Since it is possible to use a newer
version of the Advantage Database Server with an older version of the
Advantage CA-Clipper Client, any new and additional worker thread
activity information that may exist if using a newer version of the
Advantage Database Server will not be returned in the second dimension
of the returned 2-D array.
Since it is possible that the number of elements in the second dimension
of the returned 2-D array will increase in future releases of Advantage,
it is highly recommended that the length of the second dimension of the
returned 2-D array be calculated using the Len() function, rather than
hard-coding the expected length to a literal value.
The Worker Thread Number element (the first element) of the second
dimension of the returned 2-D array is the Advantage Database Server
internal thread number.
The Advantage Operation Code element (the second element) of the second
dimension of the returned 2-D array is a numeric value indicating the
Advantage operation currently being performed.
The User Name element (the third element) of the second dimension of the
returned 2-D array is the Advantage client's computer name.
The Connection Number element (the fourth element) of the second
dimension of the returned 2-D array is the NetWare connection number
for the corresponding user and is only applicable to the Advantage
Database Server for NetWare. This value will be zero if
AX_WorkerThreadActivity() is used with the Advantage Database
Server for any other OS.
Example
// Must first get a connection to the Advantage Database Server
USE x:dummy.dbf VIA "DBFCDXAX"
// Get info about all active worker threads on ADS
aThreadInfo := AX_WorkerThreadActivity()
if ( Len( aThreadInfo ) == 0 )
? "No ADS worker threads active"
endif
// Display info about all active ADS worker threads
? Len( aThreadInfo ), "worker threads are active on ADS"
? "Info about those threads are:"
for i := 1 to Len( aThreadInfo )
?
for j := 1 to Len( aThreadInfo[i] )
?? aThreadInfo[i][j]
next
next
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson