Is the documentation for the CreateIpcQueue API outdated? Specifically for maxThreadCount, from my testing it never generated more than the default 16 threads when using the default, but the documentation says that or only support 1 or unlimited.
Also, are the threads dynamically created as need? and are they destroyed again when they are no longer needed? In other words, is the thread pool dynamic.
// Create an ipc queue.
// Please choose a unique ipc name to avoid conflicts with other programs.
// Only one ipc queue with the same name can be open at the same time.
// So if 2 programs try to create the same ipc queue, the second call will fail.
// You can specify how many threads may be created to handle incoming messages.
// If the order of the messages is crucial for you, set "maxThreadCount" to "1".
// In its current implementation "maxThreadCount" only supports "1" or unlimited.
// The parameter "maxQueueLen" is not yet implemented at all.
// The "context" is a simple pointer value that is forwarded to your callback.
function CreateIpcQueue (ipc : pchar;
callback : TIpcCallback;
context : pointer = nil;
maxThreadCount : dword = 16;
maxQueueLen : dword = $1000) : bool; stdcall;
Good question. Looking at my source code, there are 2 alternative IPC approaches, one based on pipes and one on LPC APIs. The newer LPC solution is used for newer OSs, the older one for older OSs. Anyway, when using the older pipe IPC approach, there's only either "maxThreadCount = 1" to limit threads to 1, or any other value gives you an unlimited number of threads. With the newer LPC based approach, the "maxThreadCount" parameter actually works properly. However, it's internally limited to max 64 threads.
Guess I need to update the documentation accordingly.
Also, are the threads dynamically created as need? and are they destroyed again when they are no longer needed? In other words, is the thread pool dynamic.