These routines handle events. More...
Modules | |
Single event | |
These routines handle the elements of a single event. | |
Functions | |
int | et_event_new (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime, size_t size) |
This routine is called when a user wants a blank or fresh event from the ET system into which data can be placed. | |
int | et_events_new (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, size_t size, int num, int *nread) |
This routine is called when a user wants an array of blank or fresh events from the ET system into which data can be placed. | |
int | et_event_new_group (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime, size_t size, int group) |
This routine is called when a user wants a blank or fresh event from the ET system into which it can place data and that event must belong to the given group. | |
int | et_events_new_group (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, size_t size, int num, int group, int *nread) |
This routine is called when a user wants an array of blank or fresh event from the ET system into which it can place data and those events must belong to the given group. | |
int | et_event_get (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime) |
This routine is called when a user wants to read a single event from the ET system. | |
int | et_events_get (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, int num, int *nread) |
This routine is called when a user wants to read an array of events from the ET system. | |
int | et_event_put (et_sys_id id, et_att_id att, et_event *pe) |
This routine is called when a user wants to return a single, previously read or new event into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station. | |
int | et_events_put (et_sys_id id, et_att_id att, et_event *pe[], int num) |
This routine is called when a user wants to return an array of previously read or new events into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station. | |
int | et_event_dump (et_sys_id id, et_att_id att, et_event *pe) |
This routine is called when a user wants to get rid of a single, previously read or new event so that no user processes downstream will ever see it. | |
int | et_events_dump (et_sys_id id, et_att_id att, et_event *pe[], int num) |
This routine is called when a user wants to get rid of an array of previously read or new events so that no user processes downstream will ever see them. |
These routines handle events.
This routine is called when a user wants to get rid of a single, previously read or new event so that no user processes downstream will ever see it.
It is placed directly into the ET system's ET_GRANDCENTRAL station which recycles it. This will never block.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | pointer to the event to return to the ET system. |
References et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_dump(), et_system_lock(), et_system_unlock(), et_temp_remove(), etn_event_dump(), etr_event_dump(), et_attach::events_dump, et_event_t::filename, et_id_t::locality, et_event_t::memsize, et_system_t::ntemps, et_event_t::owner, et_event_t::pdata, et_id_t::sys, and et_event_t::temp.
int et_event_get | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event ** | pe, | |||
int | mode, | |||
struct timespec * | deltatime | |||
) |
This routine is called when a user wants to read a single event from the ET system.
The 4th argument has a number of options. The ET_SLEEP option waits until an event is available before it returns and therefore may "hang". The ET_TIMED option returns after a time set by the last argument. Finally, the ET_ASYNC option returns immediately whether or not it was successful in obtaining a new event for the caller.
For remote users, the previously mentioned macros may be ORed with ET_MODIFY. This indicates to the ET server that the user intends to modify the data and so the server must NOT place the event immediately back into the ET system, but must do so only when et_event_put is called. Alternatively, instead of ET_MODIFY, ET_MODIFY_HEADER can be used when the user intends to modify only the meta data. This avoids sending all the data over the network.
For remote users, if neither ET_MODIFY nor ET_MODIFY_HEADER are used, the previously mentioned macros may be ORed with ET_DUMP. Normally, ET events on the server are sent over the network to the client and then immediately put back into the system. If this flag is used, the server dumps the events instead (they're sent directly back to Grand Central).
For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | a pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe". | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. | |
deltatime | used only with the mode = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. |
References et_system_t::attach, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_WAKEUP, ET_EVENT_TEMP, ET_GRANDCENTRAL, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_read(), et_temp_attach(), ET_TIMED, ET_WAIT_MASK, etn_event_get(), etr_event_get(), et_attach::events_get, et_attach::stat, and et_attach::status.
int et_event_new | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event ** | pe, | |||
int | mode, | |||
struct timespec * | deltatime, | |||
size_t | size | |||
) |
This routine is called when a user wants a blank or fresh event from the ET system into which data can be placed.
Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment while waiting to read an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | a pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe". | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller. | |
deltatime | used only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. | |
size | the number of bytes desired for the event's data. |
References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, et_event_new_group(), ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_read(), ET_TIMED, ET_WAIT_MASK, etn_event_new(), etr_event_new(), et_sys_config_t::event_size, et_attach::events_make, et_event_t::group, et_system_t::hz, et_sys_config_t::ntemps, et_system_t::ntemps, and et_attach::status.
int et_event_new_group | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event ** | pe, | |||
int | mode, | |||
struct timespec * | deltatime, | |||
size_t | size, | |||
int | group | |||
) |
This routine is called when a user wants a blank or fresh event from the ET system into which it can place data and that event must belong to the given group.
Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to read an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | a pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe". | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller. | |
deltatime | used only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. | |
size | the number of bytes desired for the event's data. | |
group | is the group number of event to be acquired |
References et_events_new_group().
Referenced by et_event_new().
This routine is called when a user wants to return a single, previously read or new event into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station.
This will never block.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | pointer to the event to return to the ET system. |
References et_event_t::age, et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_EVENT_USED, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_write(), etn_event_put(), etr_event_put(), et_attach::events_put, et_event_t::length, et_id_t::locality, et_event_t::memsize, et_event_t::owner, et_event_t::pdata, et_attach::stat, et_id_t::sys, and et_event_t::temp.
This routine is called when a user wants to get rid of an array of previously read or new events so that no user processes downstream will ever see them.
They are placed directly into the ET system's ET_GRANDCENTRAL station which recycles them. This will never block.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | array of events to return to the ET system. | |
num | number of events to return to the ET system. |
References et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_ndump(), et_system_lock(), et_system_unlock(), et_temp_remove(), etn_events_dump(), etr_events_dump(), et_attach::events_dump, et_id_t::locality, et_system_t::ntemps, and et_id_t::sys.
int et_events_get | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event * | pe[], | |||
int | mode, | |||
struct timespec * | deltatime, | |||
int | num, | |||
int * | nread | |||
) |
This routine is called when a user wants to read an array of events from the ET system.
The 4th argument has a number of options. The ET_SLEEP option waits until events are available before it returns and therefore may "hang". The ET_TIMED option returns after a time set by the last argument. Finally, the ET_ASYNC option returns immediately whether or not it was successful in obtaining new events for the caller.
For remote users, the previously mentioned macros may be ORed with ET_MODIFY. This indicates to the ET server that the user intends to modify the data and so the server must NOT place the events immediately back into the ET system, but must do so only when et_event_put is called. Alternatively, instead of ET_MODIFY, ET_MODIFY_HEADER can be used when the user intends to modify only the meta data. This avoids sending all the data over the network.
For remote users, if neither ET_MODIFY nor ET_MODIFY_HEADER are used, the previously mentioned macros may be ORed with ET_DUMP. Normally, ET events on the server are sent over the network to the client and then immediately put back into the system. If this flag is used, the server dumps the events instead (they're sent directly back to Grand Central).
For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.
If all processes in an ET system use block transfers such as this one, a speed increase of over 10X the single transfer rate is possible. For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | array of event pointers. | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. | |
deltatime | used only with the mode = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. | |
num | the number of desired events. | |
nread | pointer which is filled with the number of events actually returned. |
References et_system_t::attach, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_WAKEUP, ET_EVENT_TEMP, ET_GRANDCENTRAL, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread(), et_temp_attach(), ET_TIMED, ET_WAIT_MASK, etn_events_get(), etr_events_get(), et_attach::events_get, et_event_t::pdata, et_attach::stat, and et_attach::status.
int et_events_new | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event * | pe[], | |||
int | mode, | |||
struct timespec * | deltatime, | |||
size_t | size, | |||
int | num, | |||
int * | nread | |||
) |
This routine is called when a user wants an array of blank or fresh events from the ET system into which data can be placed.
If all processes in an ET system use block transfers such as this one, a speed increase of over 10X the single transfer rate is possible. Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment while waiting to read an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | array of event pointers. | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller. | |
deltatime | used only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. | |
size | the number of bytes desired for an event's data. | |
num | the number of desired events. | |
nread | pointer which is filled with the number of events actually returned. |
References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, et_events_new_group(), ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread(), ET_TIMED, ET_WAIT_MASK, etn_events_new(), etr_events_new(), et_sys_config_t::event_size, et_attach::events_make, et_event_t::group, et_system_t::hz, et_event_t::length, et_event_t::memsize, et_system_t::ntemps, et_sys_config_t::ntemps, et_event_t::pdata, and et_attach::status.
int et_events_new_group | ( | et_sys_id | id, | |
et_att_id | att, | |||
et_event * | pe[], | |||
int | mode, | |||
struct timespec * | deltatime, | |||
size_t | size, | |||
int | num, | |||
int | group, | |||
int * | nread | |||
) |
This routine is called when a user wants an array of blank or fresh event from the ET system into which it can place data and those events must belong to the given group.
Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to read an event.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | array of event pointers. | |
mode | either ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller. | |
deltatime | used only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored. | |
size | the number of bytes desired for the event's data. | |
num | the number of desired events. | |
group | is the group number of event to be acquired | |
nread | pointer which is filled with the number of events actually returned. |
References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread_group(), ET_TIMED, ET_WAIT_MASK, etn_events_new_group(), etr_events_new_group(), et_sys_config_t::event_size, et_attach::events_make, et_system_t::hz, et_event_t::length, et_event_t::memsize, et_system_t::ntemps, et_sys_config_t::ntemps, et_event_t::pdata, and et_attach::status.
Referenced by et_event_new_group(), and et_events_new().
This routine is called when a user wants to return an array of previously read or new events into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station.
This will never block.
id | id of the ET system of interest. | |
att | the attachment id. This is obtained by attaching the user process to a station with et_station_attach. | |
pe | array of events to return to the ET system. | |
num | number of events to return to the ET system. |
References et_event_t::age, et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_EVENT_USED, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_nwrite(), etn_events_put(), etr_events_put(), et_attach::events_put, et_id_t::locality, et_event_t::modify, et_attach::stat, and et_id_t::sys.