next up previous contents
Next: ddu_set_brccmd Up: User Routines Previous: ddu_get_fev

ddu_brc_fev

Usage: int ddu_brc_fev(struct fifo_entry *fev, int wait)
Returns: 0 if good status, -1 if bad status.
Arguments: fifo_entry fev to be broadcasted, int wait
This routine allows to broadcast a fifo_entry to all processes attached to a fifo of the DD system depending on the value of their broadcast flag (as set by ddu_set_brc):

 
 brc_flag  		  DD_BRC_OFF  		 no broadcast to this process

DD_BRC_USMAIL n copies of fev are written into the fifos

where n is the number of processes attached to the fifo.

Note: If n greater 1, then it is not garanteed the every

process will get one copy of fev (one process might be

fast enough to grab two copies!).

DD_BRC_SIGNAL every process is garanteed to get one copy

of fev, which are distributed using signals and a

special broadcast fifo.

DD_BRC_OFF process will not be considered in the broadcasts

process.

The calling process either returns immediately ( wait == 0) or waits at most wait msec before it times out.
If the calling process is a consumer, it will not receive a fev (doesn't send a signal to himself!).

NOTE: Usage of fev.ctlw2 and fev.ctlb2
fev.ctlw2 and fev.ctlb2 have a special role in the broadcast command. fev.ctlw2 is used as a broadcast marker and is not available for the user during this call. fev.ctlb2 is used for broadcasting commands.
Broadcasting commands: The fev is interpreted as a broadcast command, if fev.ctlb2 has the following format:

where command is a 16 bit integer. DD_BRCCMD_MARKER is defined in dbfi.h.
In this case the broadcast is only sent to those processes that ask for broadcast and have their broadcast command for int cmd defined, i.e. they previously set the broadcast command to a function by calling ddu_set_brccmd. Upon receiving that broadcast command, they call the routine brc_cmd_fcn. ctlw1 and ctlb1 are the calling arguments for brc_cmd_fcn and can be used to pass additional data to the process.



next up previous contents
Next: ddu_set_brccmd Up: User Routines Previous: ddu_get_fev



Online software development
Thu Mar 14 10:35:53 EST 1996