AW: [En-Nut-Discussion] Ethernut Docu Improvements
Oliver Schulz
Oliver.Schulz at bong.de
Thu Jan 29 11:17:27 CET 2004
Hi Matthias,
> reading the events.c file, I got the picture.
>
> - the queue is a 16 bit counter and instead of sending
Sorry, but it is not a 16 bit counter. This queue itself is just a concatenated list of NUTTHREADINFO structs.
The parameter given to NutEventWait is a pointer to a HANDLE, which is in turn a pointer to void.
That means 'qhp' is just a void **. The HANDLE (*qph) points to the head of the list, i.e. the first thread waiting for the "event".
> an event, the task(s) waiting on the "queue" is signaled.
> - the "queue" turns out to be a semaphore.
Not really right. Semaphores are used for controlling access to a shared resource that can only support a limited number of users. For that reason each semaphore has a counter and a limit. On 'Locking' the semaphore the counter value is incremented. If the limit is reached, the calling thread will be blocked and unblocked if counter falls below the limit.
> so, I would recommend:
> replace "queue" by semaphore
Hmm... Actually no.
> replace "event" by signal
Well, the terminus 'signal' is used in some other meaning. Under Linux an Win32 every application can receive a signal, which means a special error has occured and normally the application is terminated. So 'signal' is not the correct notation.
>
> a simple question: does anybody need or did implement messsage queues
> or message passing?
Very interessing topic. I also thought about it and in release 3.5 of Nut/OS I'll try to add some code for simple message passing (like in win32) and message queueing.
Any comments?
Cheers,
Oliver.
More information about the En-Nut-Discussion
mailing list