FairCom Corporation


F.61 ctThrdInit


Initialize thread management.

Short Name

ctThrdInit

TYPE

Threading function

DECLARATION

NINT ctThrdInit(NINT numthreads, LONG mode, pctINIT cfg)

DESCRIPTION

ctThrdInit initializes c-tree Plus thread management. When using a multithreaded c-tree Plus library, you must call ctThrdInit before initializing c-tree Plus.

mode is either zero or ctThrdFIXED_THREADS. In ctThrdFIXED_THREADS mode numthreads represents the fixed maximum number of threads available at one time. Otherwise, numthreads simply represents the number of threads allocated each time new threads are required.

cfg should be NULL for non-server applications. In the Bound Server Model, cfg points to a parameter block representing the c-tree Server configuration file options. If cfg is NULL, the bound c-tree Server, i.e., Custom Server, is initialized similarly to a standard c-tree Server.

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful thread initialization.
82
UALC_ERR
Could not allocate memory.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

COUNT retval2;
NINT retval4;
if (retval4 = ctThrdInit(5, NULL, NULL)) {
ctThrdTerm();
return(retval4);
}
if ((retval2 = InitISAM(6, 25, 32)) {
CloseISAM();
return((NINT) retval2);
}
dbWork();
CloseISAM();
ctThrdTerm();
return(0)

LIMITATIONS

Required with a ctThrd library.

SEE ALSO

ctThrdTerm


FairCom Corporation
www.faircom.com