Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Inter-Task Communications Alternate APIs for RTKernel-32 |
Inter-Task CommunicationsThe term inter-task communication comprises all mechanisms serving to exchange information among tasks. RTKernel-32 offers three different techniques: semaphores, mailboxes, and message passing. Semaphores are offered by virtually all multitasking systems. They allow the exchange of signals for activating and suspending tasks. A semaphore is a variable signals can be stored in or read from. Task switches may take place whenever a semaphore containing 0 signals is accessed. RTKernel-32 defines five different types of semaphores: counting, binary, event, resource, and mutex. Mailboxes extend the concept of semaphores. Instead of signals, data of any type can be stored in or read from a mailbox. A task switch occurs whenever an empty or a full mailbox is accessed. The number of data records a mailbox can store is configurable. Mailboxes are especially suited for data buffering between tasks or between interrupt handlers and tasks. Message passing serves to exchange data directly between two tasks; specifically, no data or signals will be buffered. This represents the tightest coupling between tasks because the tasks involved must synchronize for the data exchange. Multitasking, Real-Time, and RTKernel-32
|