kkelkar wrote on Thursday, July 19, 2007:
If multiple tasks are trying to write to the same queue, do I need to do anything differently to protect these queue writes from context switches?
For example, say I have an application with multiple tasks, each gathering information from different sources. One additional task is responsible for reporting this information through a communications pipe. Can I create one queue that each of the producer tasks writes to and the consumer task reads from, or do I need to have multiple queues, one for each producer task?
If I also want to have a status variable that is accessed by each of these tasks, can I merely create a global variable and surround any reads and writes to this variable with:
portENTER_CRITICAL();
// write to or read from global variable
portEXIT_CRITICAL();
Thanks