Lines Matching refs:events

50  * to submit user-defined events to a port. The idea of the
51 * user-defined events is to use the event ports for communication between
52 * threads/processes (like message queues). User defined-events are queued
56 * for events with the "highest priority" (priority here is related to the
59 * the requirement to have events which should be submitted immediately
64 * Threads trying to retrieve events from a port in alert mode will
68 * An event port is like a kernel queue, which accept events submitted from
69 * user level as well as events submitted from kernel sub-systems. Sub-systems
70 * able to submit events to a port are the so-called "event sources".
72 * PORT_SOURCE_AIO : events submitted per transaction completion from
74 * PORT_SOURCE_TIMER : events submitted when a timer fires
76 * PORT_SOURCE_FD : events submitted per file descriptor (see poll(2)).
77 * PORT_SOURCE_ALERT : events submitted from user. This is not really a
80 * PORT_SOURCE_USER : events submitted by applications with
82 * PORT_SOURCE_FILE : events submitted per file being watched for file
83 * change events (see port_create(3c).
91 * retrieve events from that file descriptor.
97 * port_getn() : retrieve a list of events from a port
122 * The second step is the triggering of events, which could be sent to a port.
123 * Every event source implements an own method to generate events for a port:
137 * All the events submitted per transaction are of type
153 * events argument of port_associate() the type of events which it is
158 * the event triggered (see valid events in poll(2)).
162 * event slot from the port. Anyway, file descriptors deliver events
172 * retrieve events from a port.
182 * in the events argument.
183 * A file events monitor is represented internal per port per object
187 * hooks, the file's vnode ops are intercepted and relevant events
189 * file events monitor on a file. When the specified file is
190 * removed/renamed, the file events watch/monitor is automatically
195 * - the application uses port_get() or port_getn() to retrieve events,
199 * The maximal number of events in a port queue is the maximal number
202 * control: process.port-max-events.
204 * function retrieves a list of events.
205 * Events are classified as shareable and non-shareable events across processes.
206 * Non-shareable events are invisible for the port_get(n)() functions of
209 * PORT_SOURCE_USER events
214 * PORT_SOURCE_ALERT events
219 * PORT_SOURCE_FD events
222 * the processes. The child process is allowed to retrieve events
231 * PORT_SOURCE_AIO events
233 * PORT_SOURCE_TIMER events
235 * PORT_SOURCE_FILE events
243 * it can retrieve events from all common associated file descriptors.
250 * descriptors as well as all non-shareable events will be discarded.
275 * - submitted events (represented by port_kevent_t structures)
329 * 3. Delivery of events to the event port
341 * events field, which will be delivered to the application.
342 * (see Delivery of events to the application).
350 * 4. Delivery of events to the application
351 * The events structures/slots delivered by event sources remain in the
354 * The application uses port_get() or port_getn() to retrieve events from
357 * Both functions are able to poll for events and return immediately or they
359 * Before the events are delivered to the application they are moved to a
363 * new events to the port.
365 * a) retrieve single events from the temporary queue,
375 * e) repeat a) until d) as long as there are events in the queue and
621 * port_getn() can only retrieve own or shareable events from
623 * kernel until own or shareable events are available or the
661 /* user-defined events */
668 * library events, blocking
669 * Only events of type PORT_SOURCE_AIO or PORT_SOURCE_MQ
697 if ((int)a2) /* a2 = events */
755 * Retrieve the maximal number of events allowed per port from
756 * the resource control: process.port-max-events.
822 /* Allocate cache skeleton for PORT_SOURCE_FD events */
883 * a port as long as the number of events per port does not achieve the
884 * maximal allowed number of events. The max. number of events per port is
885 * defined by the resource control process.max-port-events.
888 * event ports API and submits events of type PORT_SOURCE_USER. The
890 * functions to submit events of other types than PORT_SOURCE_USER
894 port_send(port_t *pp, int source, int events, void *user)
904 pev->portkev_events = events;
921 * Currently the libaio uses the port_dispatch() function to deliver events
926 port_noshare(void *arg, int *events, pid_t pid, int flag, void *evp)
935 * libraries involved in the project to deliver events to the port.
942 port_dispatch_event(port_t *pp, int opcode, int source, int events,
953 pev->portkev_events = events;
975 port_sendn(int ports[], int errors[], uint_t nent, int events, void *user,
1032 pev->portkev_events = events;
1073 port_alert(port_t *pp, int flags, int events, void *user)
1096 * which are using port_get(n) to retrieve events.
1100 pa->portal_events = events; /* alert info */
1108 /* no threads waiting for events */
1115 * Every thread waiting for events already allocated a portget_t
1124 pa->portal_events = events;
1147 * The port_getn() function is used to retrieve events from a port.
1149 * The port_getn() function returns immediately if there are enough events
1154 * should return immediately depending on the number of events available.
1191 * Return number of objects with events.
1194 * retrieving events from the port queue.
1198 * Check if a second thread is currently retrieving events
1202 /* put remaining events back to the port queue */
1215 if (*nget == 0) { /* no events required */
1238 * Now check if the completed events satisfy the
1248 * this thread could not find events to return.
1250 * events generated in other processes.
1252 * checked the current event queue and no new events
1257 /* some new events arrived ...check them */
1264 /* check if enough events are available ... */
1268 * There are not enough events available to satisfy
1270 * incoming events.
1280 if (blocking == 0) /* don't block, check fired events */
1312 * events (portq_getn > 0).
1340 /* return without events */
1349 * New incoming events will be continue be posted to the event queue
1354 * a) incoming events use the port queue mutex to enqueue new events and
1358 * the queue mutex would block incoming events.
1359 * During this time incoming events (port_send_event()) do not need
1360 * to awake threads waiting for events. Before the current thread
1363 portq->portq_getn++; /* number of threads retrieving events */
1369 * Move remaining events from previous thread back to the
1377 tnent = portq->portq_nent; /* get current number of events */
1378 portq->portq_nent = 0; /* no events in the port event queue */
1379 portq->portq_flags |= PORTQ_WAIT_EVENTS; /* detect incoming events */
1394 if (pev == NULL) /* no more events available */
1418 nevents++; /* # of events ready */
1436 if (pev == NULL) /* no more events available */
1460 nevents++; /* # of events ready */
1467 * Remember number of remaining events in the temporary event queue.
1473 * - push list of remaining events back to the top of the standard
1485 * move remaining events in the temporary event queue back
1490 portq->portq_getn--; /* update # of threads retrieving events */
1497 /* do not copyout events */
1503 * no other threads retrieving events ...
1513 * the number of events in the queue to zero.
1531 /* no events retrieved: check loop conditions */
1572 * event source to update events, to free local resources associated with
1627 * event source to update events, to free local resources associated with
1709 * - threads waiting for events
1793 * Threads requiring more events than available will be put in a wait queue.
1795 * Threads requiring less events get a higher priority than others and they
1818 * thread waiting for less events will be set on top of the queue.