Home Download News FAQ / Knowledge Base Screenshots Documentation Support
philosophical imaginary

Threads

Threads are the workhorse of Citadel. Everything Citadel does is done by a thread of some sort. You may not need to create any threads yourself to do useful work, indeed few modules create threads, most use the event functions that are called by one of the system worker threads.

Even if you do not create any threads you must write your code in a thread safe manner, after all your code will be run by a thread. Any events or other services you register with a call to CtdlRegister* will not necessarily be run by the same worker thread and will certainly not be run by any thread you create.

CtdlThreadCreate()

struct CtdlThreadNode *CtdlThreadCreate(char *name, int flags, void *(*thread_func) (void *arg), void *args);

Call this function to create a new thread.

Copyright © 1987-2016 Uncensored Communications Group. All rights reserved.     Login (site admin)