Pumpkin, Inc.

Pumpkin User Forums

Call for Suggestions -- Improved Event Flags

Have an idea on how to make Salvo better? Post it here!

Call for Suggestions -- Improved Event Flags

Postby aek » Wed Oct 09, 2002 4:12 am

Hi All.

First, read this: http://www.pumpkininc.com/ubb/Forum7/HTML/000107.html.

Now, the question: What kind of interface would you as users like in terms of signaling the eFlag?

Right now, you can set or clear bits in the eFlag using a mask and an option. You cannot, for example, toggle bits, nor can you do more than a single operation at a time. This is not efficient.

I think it would be much more useful if you could perform multiple operations on an eFlag at once, within a single call to OSSignalEFlag(). E.g. you could clear bits 7-4, toggle bit 3, set bit 2 and clear bits 1-0 based on some other condition. Wouldn't that be neat?

To me, the ideal way to do this is to super-generalize it, in that a call to OSSignalEFlag() would look something like:

code:
OSSignalEFlag(ecbP, MyEFlagSignalingFn());

where
code:
char MyEFlagSignalingFn(ecbP)

operates on the specified eFlag as you wish. OSSignalEFlag() would call your function, then see if the resultant eFlag should wake an eligible waiting task ...

On the OS_WaitEflag() side, you would also define a function -- this one would look like

code:
OStypeErr MyEFlagWaitingFn(ecbP)

which would simply return TRUE or FALSE based on whether the eFlag is the value you expect it to be for the task to successfully wait the eFlag.

You can have as many of your own different eFlag signaling and waiting functions as you like ... The current eFlag API would be replaced with this ...

So, what do you think?

------------------

[This message has been edited by aek (edited October 09, 2002).]

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

Re: Call for Suggestions -- Improved Event Flags

Postby jtemples » Wed Oct 09, 2002 4:27 am

I use event flags almost exclusively for my inter-task communications. My usage paradigm is always signal a single bit, wait on multiple bits. Each of the waited-on bits has an individual meaning; I haven't had any need to assign meaning to combinations of bits. I don't know if that's a common usage scenario for other folks.

In other words, I'm happy with the API as it is now.

jtemples
 
Posts: 45
Joined: Tue Jul 16, 2002 11:00 pm

Re: Call for Suggestions -- Improved Event Flags

Postby luben » Tue Oct 15, 2002 1:12 am

Hello,

I think that this is the perfect solution for the event flags - to have a function that tracks the event flags. I don't know how to say it, but this is just what I wished from the event flags from their beginning. One of the reason not to use very often event flags in current SALVO was the limited set of possible logical operation over them. With the user defined function you make event flags extremely powerful and in the same time flexible. Excellent...

This will make possible for example to track pins of the uP, variables, counters,.... everything.

Well, from other side you should keep in mind that this will increase the kernel and maybe it will slow down the performance.

Best regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Call for Suggestions -- Improved Event Flags

Postby aek » Tue Oct 15, 2002 3:12 am

Hi Luben.

I think the kernel will actually shrink, and will run faster.

The user will have to do a bit more work to configure the eFlags ... but we'll provided canned routines to do the functionality (any|all|exact bits) that is currently there, so in many cases user's won't have to write their own functions.

------------------

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


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests

cron