We're using flags to wakeup threads. We use different bit
contained within one flag for signaling. (i.e. CAN_RX is bit 1,
SHUTDOWN is bit2, etc.)

I have some questions/comments regarding the use
of this kernel feature:

1) the flag_result returned with cyg_flag_timed_wait()
  contains all of the current bits set not the mask
  supplied with the cyg_flag_timed_wait() call.

  It seems to me that the result should only return the
  bits this call is interested in seeing. Is this
  expected behaviour?


2) the cyg_flag_setbits() routine in flags.cxx clears
  the current value of the flag upon finding the first
  thread waiting on the bit(s). It should wait until
  all tasks are woken before clearing the flag bits.
  It too suffers from the problem that the entire flag
  is cleared, not just the bit(s) desired.
  This means that multiple threads cannot use the
  same cyg_flag_t to wait for different (or common) bits.

An I misunderstanding the use of the flag feature?



Thanks,
Dave



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply via email to