Pumpkin User Forums
  Coding
  Tasks waiting on the same event flag

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Tasks waiting on the same event flag
aek
Moderator
posted October 09, 2002 17:15     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Please also see http://www.pumpkininc.com/ubb/Forum2/HTML/000042.html.

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

IP: 63.203.232.106

jtemples
Member
posted October 09, 2002 17:06     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
I wasn't clear; I should have said "signal a single bit in the wait mask." It sounds like that's going to work ok.

IP: 209.239.242.114

aek
Moderator
posted October 09, 2002 17:02     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Hello.
quote:
I can still, for example, wait on a mask of 0xF0 with OSANY_BITS, and signal a single bit, and timeouts will work correctly?
The task will timeout if the eFlag is not signaled within the timeout period. If the eFlag is signaled within the timeout period, even by, say, setting bit 0 (i.e. xxxxxxx1 is the result), then the task will not timeout. But since in your case I believe you will only signal the eFlag in question with bits 7-4, then you'll be OK.

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

IP: 63.203.232.106

jtemples
Member
posted October 09, 2002 16:51     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
Thanks for the clarification.

Just so that I'm clear on the Service Bulletin,

quote:

This will solve the timeout problem, but only if the eFlag is set (signaled) with exactly the mask and options with which the task is waiting the eFlag.

I can still, for example, wait on a mask of 0xF0 with OSANY_BITS, and signal a single bit, and timeouts will work correctly?

IP: 209.239.242.114

aek
Moderator
posted October 09, 2002 16:40     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Hello.

Don't bother sending the sample project -- what you observed is the correct behavior for the code as it is written.

We've issued a Service Bulletin SB-14 for it:http://www.pumpkininc.com/ubb/Forum12/HTML/000014.html. Be sure to read it ...

However, that doesn't mean that it is the expected or documented behavior, does it?

Salvo's internal workings with eFlags are different from all other event types. What is happening is that each time an eFlag is signaled, all the tasks that wait the eFlag wake up / are made eligible, and then they all run and analyze whether the event (with option and mask) they are waiting on has occurred. Therefore any task that waits an eFlag with a timeout will wake up whenever the eFlag is signaled.

As you can see, the current eFlag implementation leaves something to be desired ...

But never fear, I believe there is a way that we can implement more advanced eFlags, solve this timeout problem and improve performance at the same time. The idea is for the user to define an arbitrary "event flag validating function" for each task+eFlag combo. This way, you're not limited to the options (ANY|ALL|EXACT_BITS) that we currently provide. The trick in all this is to minimize RAM usage, and I think I now see an elegant way to do it ... but this improvement will not come before the v3.1.x release ...

For now, keep on doing what you've been doing. It costs you a small amount of RAM (one ecb and one efcb), but you'll actually get better system performance that way.

Regards

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

IP: 63.203.232.106

aek
Moderator
posted October 09, 2002 11:41     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Hello.

Doesn't seem like you're doing anything wrong -- can you make up a small project that exhibits this problem and email it to support@pumpkininc.com?

Thanks,

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

IP: 63.203.232.106

jtemples
Member
posted October 09, 2002 11:39     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
I've run into this situtation on a couple of projects now, but I haven't taken the time to try to build a small test case. I'm wondering if this is something in the manual I've overlooked.

I have two tasks, A and B, and an event flag E.

Task A waits on event flag E with mask 0xF0 and no timeout.

Task B waits on event flag E with mask 0x0F and a timeout.

Some combination of circumstances causes task B's timeout to never happen, although it continues to receive event flags. Timeouts are still working elsewhere in the code, as are OS_Delay calls.

Giving task B its own event flag solves the problem.

IP: 209.239.242.114

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Pumpkin Home Page

2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a