06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pSOS+ <strong>System</strong> <strong>Calls</strong> ev_receive<br />

See Also<br />

2. The ev_receive() call captures only the events that the caller selects. It<br />

captures each selected event once. If a pending event does not match a selected<br />

event, the pending event remains pending. Also, if a pending event was sent<br />

after an earlier event was used to match a selected event, the pending event<br />

remains pending. Consider the following example sequence:<br />

a. Task P has pending events 1 and 2.<br />

b. With EV_ALL set, P calls ev_receive() for events 1, 3, and 8. Pending<br />

event 1 is cleared.<br />

c. Task A sends events 1 and 8 to P.<br />

d. Event 1 is made pending. Event 8 is used to match the wanted event.<br />

e. Task B sends events 2, 3, and 5 to P. Event 2 has no effect because event 2<br />

is already pending. Event 5 is unwanted and made pending. Event 3 is used<br />

to match a wanted event. The event condition is met, so P becomes ready to<br />

run.<br />

f. Events 1, 2, and 5 are left pending.<br />

g. Events 1, 3, and 8 are returned in events_r.<br />

Multiprocessor Considerations<br />

None. The actions performed by ev_receive() take place only on the local node<br />

(whether or not events come from other nodes).<br />

Callable From<br />

■ Task<br />

ev_send<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-29<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!