1
.\" This man page is Copyright (C) 2010 Lennert Buytenhek.
2
.\" Permission is granted to distribute possibly modified copies
3
.\" of this page provided the header is included verbatim,
4
.\" and in case of nontrivial modification author and date
5
.\" of the modification is added to the header.
6
.TH iv_event_raw 3 2010-09-02 "ivykis" "ivykis programmer's manual"
8
IV_EVENT_RAW_INIT, iv_event_raw_register, iv_event_raw_unregister, iv_event_raw_post \- manage ivykis objects for event notification
10
.B #include <iv_event_raw.h>
15
void (*handler)(void *);
19
.BI "void IV_EVENT_RAW_INIT(struct iv_event_raw *" this ");"
21
.BI "int iv_event_raw_register(struct iv_event_raw *" this ");"
23
.BI "void iv_event_raw_unregister(struct iv_event_raw *" this ");"
25
.BI "void iv_event_raw_post(struct iv_event_raw *" this ");"
29
provides a way for delivering events to
31
recipients across thread and process boundaries.
33
The intended event recipient calls
36
.B struct iv_event_raw
42
.B iv_event_raw_register
45
To generate an event, call
47
on the previously initialized
48
.B struct iv_event_raw
49
object. This will cause the callback specified by
51
to be called in the thread that the
52
.B struct iv_event_raw
53
object was registered in, with
58
.B struct iv_event_raw
60
.B iv_event_raw_unregister
61
from the same thread that
62
.B iv_event_raw_register
63
was called from on that object.
65
It is permitted to unregister a
66
.B struct iv_event_raw
67
object from any ivykis callback function in the thread it was
68
registered in, including from a callback function triggered by this
69
object, and it is permitted to free the memory corresponding to an
70
unregistered object from its own callback function.
73
can be called from the same thread that
74
.B iv_event_raw_register
75
was called from, from a different thread in the same process, or even
76
from a different process, and can safely be called from signal handlers.
78
If posting an event only ever needs to be done from within the same
81
for a lighter-weight alternative to
86
is implemented by registering a file descriptor (a struct
88
with the recipient thread's ivykis event loop, and by causing that
89
file descriptor to become readable upon a call to
94
is available, it will be used to procure the abovementioned file
99
as the source of its file descriptors.
101
is preferred as it requires only one file descriptor table entry
104
requires two), and has much less kernel overhead than