FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2006 Threads] Two tasks wait for the same eventPosted by Tzu-Chien Chiu on September 15, 2006 Hello, all:
With the only schronization object binary semaphore (implemented by a queue), how could I simulate that more than one tasks simulatenously wait for one single resource?
For example, a Win32 event. Multiple threads can wait/block on the same event. Once the event is "set", all those threads are resumed.
RE: Two tasks wait for the same eventPosted by Nobody/Anonymous on September 15, 2006 When a thread finishes using the resource, it gives back the semaphore, waking any other threads which were also waiting for it.
RE: Two tasks wait for the same eventPosted by Tzu-Chien Chiu on September 15, 2006 The binary semaphore is implemented by a queue of length one. Once the element is recevied by a blocking task, the queue is empty and the other tasks cannot be waked (received anything from the queue).
RE: Two tasks wait for the same eventPosted by Nobody/Anonymous on September 15, 2006 Right, then the formerly-blocking task that was awakened first gives the semaphore back when it's done (putting it back onto the queue), and wakes up the next blocking task in line, which also gives the semaphore back when it's done, waking up the next blocking task, and so on.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|