1 / 6

EECE **** Embedded System Design

EECE **** Embedded System Design. Task Communications. Tasks need to communicate:. Shared data structure: Queue Operations: (RTOS services) »Queue Initialize(intsize): create and set up for size »Void Enqueue(Queueq,void* item): block if full, else put

cliff
Download Presentation

EECE **** Embedded System Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EECE **** Embedded System Design

  2. Task Communications • Tasks need to communicate: • Shared data structure: Queue • Operations: (RTOS services) • »Queue Initialize(intsize): create and set up for size • »Void Enqueue(Queueq,void* item): block if full, else put • »Void* Dequeue(Queueq): block if empty, else get • Multiple tasks use it: mutual exclusionis enforced

  3. Task Communications • Mailboxes: »Similar to queues, (usually) has a single element and two states: empty/full »If multiple tasks are waiting for a mailbox, the highest priority one gets the message • Pipes: »Streams of data »Typically use fwrite/freadoperations »Arbitrary length and data format

  4. Using Queues 1-to-1: 1-to-Many:

  5. Using Queues (2) Many-to-1: Double Buffer:

  6. Problems with Queues • If of finite size, task may block/receive error if full/empty • Passing pointers as queue elements: data becomes shared (“ownership” changes) • The sender and the receive must agree on the format/meaning of the data passed • »void* is not a very good idea • Memory management: running out of memory space leads to disasters (or reboots)

More Related