libinco_32
 All Files Functions Enumerations Enumerator Macros Modules Pages
Multithreading Considerations

Overview

INCO API functions are generally threadsafe in the sense that they can be called from arbitrary application threads. For every thread, libinco_32 will setup an individual communication channel to the target via INCOServer. These resources are managed by libinco_32 and automatically released when an application thread exists. However, there a few points to consider:

CallProcedureEx

By default, tickets cannot be passed between threads, meaning that only the thread that received a ticket using CallProcedureEx() can wait for asynchronous results using CallProcedureExWait() or CallProcedureExResult(). However, if an application requires such handling, it can allow "Ticket Delegation" by calling IncoControl() with IncoCtlAllowTicketDelegation during initialization:

// allow waiting for tickets by a different thread
uint32 uAllow = 1;
uint32 uError = IncoControl(NULL, IncoCtlAllowTicketDelegation, &uAllow, sizeof(uAllow));
if (uError) {
printf("failed to enable ticket delegation. inco_32 DLL too old?\n");
return 1;
}

This is useful in situations where a background thread is used to poll or wait for asynchronous calls to complete. There are still some limitations left:


Generated by doxygen 1.8.8