Pumpkin, Inc.

Pumpkin User Forums

some q's about processing events

If you can't make Salvo do what you want it to do, post it here.

some q's about processing events

Postby aek » Wed Dec 27, 2000 7:42 am

quote:
What happens if I start a task that waits for an event and that event is not created yet ?

That's an error -- create the event first.

quote:
What happens if an event is signalled before any task starts to wait it ? Will the event get lost or it will be processed after task starts to wait it ?

The latter -- the event will not be lost, and the highest-priority task to wait the event will get it, i.e. will remain eligible after OS_WaitXyz() instead of going to the waiting state.

quote:
What happens if an event is signalled several times before waiting task gets a chanse to run and process that event ? Will the last one signal be processed and previous lost ? Or the first will be processed and the following signals lost ?

Depends on the event -- if it's a binsem or a message, all further signaling results in OSSignalXyz() returning an error code, because the event is "full". The first event to be signaled will be processed, and subsequent ones will be lost. In the case of a sem, the value is simply incremented. In the case of a message queue, additional messages are enqueued until the queue is full. With these events, once the event is "full", subsequent signals will be lost.

quote:
Is it important what to create first, event or task that waits it ? Does the order of creation matter ?

The order doesn't matter. But if a task waits an event, the event should be created before the task runs.

quote:
What if I don't need one event anymore and want to use its slot for another event ? Can I destroy event ?

Absolutely!

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: some q's about processing events

Postby NoMore » Wed Dec 27, 2000 10:21 am

What happens if I start a task that waits for an event and that event is not created yet ?

What happens if an event is signalled before any task starts to wait it ? Will the event get lost or it will be processed after task starts to wait it ?

What happens if an event is signalled several times before waiting task gets a chanse to run and process that event ? Will the last one signal be processed and previous lost ? Or the first will be processed and the following signals lost ?

Is it important what to create first, event or task that waits it ? Does the order of creation matter ?

What if I don't need one event anymore and want to use its slot for another event ? Can I destroy event ?

[This message has been edited by NoMore (edited December 27, 2000).]

[This message has been edited by NoMore (edited December 27, 2000).]

NoMore
 
Posts: 11
Joined: Fri Dec 01, 2000 12:00 am

Re: some q's about processing events

Postby aek » Thu Jan 04, 2001 10:43 am

The questions in this thread have been added (with some minor editing) to the FAQ in the Salvo User Manual.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron