Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

iv_thread(3) [debian man page]

iv_thread(3)						    ivykis programmer's manual						      iv_thread(3)

NAME
iv_thread_create, iv_thread_set_debug_state - ivykis thread convenience functions SYNOPSIS
#include <iv_thread.h> int iv_thread_create(char *name, void (*start_routine)(void *), void *arg); void iv_thread_set_debug_state(int state); DESCRIPTION
iv_thread_create is a wrapper around pthread_create(3) which will maintain an ivykis main loop reference in the calling thread (which must be an ivykis(3) thread, i.e. have had iv_init(3) called in it) for as long as the created thread is alive. Maintaining a reference on the calling thread's ivykis event loop makes sure that the calling thread will not return from its ivykis main loop before the created thread exits, as that could cause cleanup still happening in the created thread to be interrupted when the calling thread subsequently calls exit(3). The created thread need not be an ivykis thread. Enabling debugging by calling iv_thread_set_debug with a nonzero argument will print a debug message to standard error whenever a thread is created via iv_thread_create, whenever a thread so created terminates normally by returning from its start_routine, self-terminates by calling pthread_exit(3), or is successfully canceled by pthread_cancel(3), and whenever destruction of such a thread is signaled back to the calling thread. For inter-thread signaling, iv_thread uses iv_event(3). SEE ALSO
ivykis(3), iv_event(3), exit(3), pthread_cancel(3), pthread_create(3), pthread_exit(3) ivykis 2010-09-13 iv_thread(3)

Check Out this Related Man Page

iv_event(3)						    ivykis programmer's manual						       iv_event(3)

NAME
IV_EVENT_INIT, iv_event_register, iv_event_unregister, iv_event_post - manage ivykis objects for event notification SYNOPSIS
#include <iv_event.h> struct iv_event { void *cookie; void (*handler)(void *); }; int IV_EVENT_INIT(struct iv_event *this); int iv_event_register(struct iv_event *this); void iv_event_unregister(struct iv_event *this); void iv_event_post(struct iv_event *this); DESCRIPTION
iv_event provides a way for delivering events to ivykis(3) recipients across thread boundaries. The intended event recipient calls IV_EVENT_INIT on a struct iv_event object, fills in ->cookie and ->handler, and then calls iv_event_reg- ister on the object. To generate an event, call iv_event_post on the previously initialized struct iv_event object. This will cause the callback specified by ->handler to be called in the thread that the struct iv_event object was registered in, with ->cookie as its sole argument. To deinitialize a struct iv_event object, call iv_event_unregister from the same thread that iv_event_register was called from on that object. It is permitted to unregister a struct iv_event object from any ivykis callback function in the thread it was registered in, including from a callback function triggered by this object, and it is permitted to free the memory corresponding to an unregistered object from its own callback function. iv_event_post can be called from the same thread that iv_event_register was called from, or from a different thread within the same process, but can not be called from a different process, and can not be called from signal handlers. If you need this functionality, look at iv_event_raw(3). Internally, iv_event is implemented as a wrapper around iv_event_raw(3), and multiplexes multiple struct iv_event objects over per-thread struct iv_event_raw objects, to save file descriptors and kernel resources. SEE ALSO
ivykis(3), iv_event_raw(3) ivykis 2010-09-03 iv_event(3)
Man Page