Standalone event flags

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
n_o_o_n
Posts: 2
Joined: Tue Oct 23, 2018 5:31 pm

Standalone event flags

Postby n_o_o_n » Tue Oct 23, 2018 5:55 pm

Hi Giovanni,

Maybe you would be interested in the proposed standalone event flags object.
It has the following differences comparing to the built-in Event Flags:
  • it's a standalone object, not associated with any thread, i.e. more than one thread could wait on the same object;
  • it supports atomic operation of wait & clear, i.e. it's possible to release either one or all threads from wait;
  • there could be an unlimited number of such objects.

It could be used either as a replacement or alongside the built-in Event Flags.
I have attached a patch against the 18.2.x branch.

Regards,
n_o_o_n.
Attachments
evtflg.patch.zip
(4.59 KiB) Downloaded 136 times

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Standalone event flags

Postby Giovanni » Tue Oct 23, 2018 6:34 pm

Hi,

Interesting variant, I will consider it for inclusion.

Some questions:
- Is it inspired to some other OS?
- What is the use case that made you write this?

Giovanni

n_o_o_n
Posts: 2
Joined: Tue Oct 23, 2018 5:31 pm

Re: Standalone event flags

Postby n_o_o_n » Wed Oct 24, 2018 11:32 am

Hi Giovanni,

Yes, it is inspired by µITRON RTOS as well as µC/OS.
There could be many use cases, for example:
  • A complex driver in which several application threads wait for both a completion of unrelated HW events and a common status/error.
  • A thread makes synchronous calls to several drivers, and each driver has its own synchronization object.
  • And of course all the use cases of Event Source/Event Listener ;).


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 10 guests