Subject:
|
Re: bug in semaphore code (was Re: Announce: NQCIPC update
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sat, 30 Oct 1999 00:17:42 GMT
|
Viewed:
|
1181 times
|
| |
| |
In lugnet.robotics, Robert Munafo writes:
> [...]
> Dave Baum and I and a few others talked about this issue 4 weeks ago in this
> thread:
>
> http://www.lugnet.com/robotics/rcx/nqc/?n=172
>
> The result was code that properly handles the lockstep starvation problem as
> well as making sure that only one task uses the semaphore at any given time.
> The solution requires the tasks to have task ID numbers.
>
> I will repeat the proper code here:
> [...]
Robert,
Cool stuff. I just added it here:
http://www.lugnet.com/robotics/rcx/nqc/?p=code
--Todd
|
|
Message has 2 Replies:
Message is in Reply To:
| | bug in semaphore code (was Re: Announce: NQCIPC update
|
| Your semaphore acquire algorithm isn't too good. Here is your code: #define sem_acquire(s) until (s == 0); s = 1; If two tasks are waiting for the semaphore at the same time, it is quite likely that both will get it: // (s is currently nonzero) task (...) (25 years ago, 29-Oct-99, to lugnet.robotics)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|