1 / 29

Real-Time Embedded Multithreading, Using ThreadX and ARM ~ Chapter11 ~

Real-Time Embedded Multithreading, Using ThreadX and ARM ~ Chapter11 ~. 學生 : 曾楓喬 指導教授 : 張軒彬. Outline. Introduction Event Flags Group Control Block Summary of Event Flags Group Control Services Sample System Using an Event Flags Group to Synchronize Two Threads

cara
Télécharger la présentation

Real-Time Embedded Multithreading, Using ThreadX and ARM ~ Chapter11 ~

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. Real-Time EmbeddedMultithreading, Using ThreadX and ARM~ Chapter11 ~ 學生 : 曾楓喬 指導教授 : 張軒彬

  2. Outline • Introduction • Event Flags Group Control Block • Summary of Event Flags Group Control Services • Sample System Using an Event Flags Group to Synchronize Two Threads • Event Flags Group Internals

  3. Introduction • Event flags provide a powerful tool for thread synchronization. • Each event flag is represented by a single bit. • Event flags are arranged in groups of 32.

  4. Event Flags Group Control Block • The characteristics of each event flags group are found in its Control Block.

  5. Summary of Event Flags Group Control Services

  6. Creating an Event Flags Group • tx_event_flags_create • Fig11.4 Attributes of an event flags group • When created, all the event flags of a group are initialized to zero.

  7. Creating an Event Flags Group(cont.)

  8. Setting Event Flags in an Event Flags Group • tx_event_flags_set • input parameter • group_ptr • flags_to_set • set_option TX_AND -> clear TX_OR -> set • The service sets or clears one or more event flags in a group.

  9. Setting Event Flags in an Event Flags Group(cont.)

  10. Setting Event Flags in an Event Flags Group(cont.) • TX_OR Current event flags group Value: 0x00 0000 0000 0000 0000 0000 0000 0000 0000 Flags to set Value: 0xFF0C 0000 0000 0000 0000 1111 1111 0000 1100 New current event flags group Value: 0xFF0C 0000 0000 0000 0000 1111 1111 0000 1100

  11. Setting Event Flags in an Event Flags Group(cont.) • TX_AND Current event flags group Value: 0xFF0C 0000 0000 0000 0000 1111 1111 0000 1100 Flags to set Value: 0x111 0000 0000 0000 0000 0000 0001 0001 0001 New current event flags group Value: 0x100 0000 0000 0000 0000 0000 0001 0000 0000

  12. Setting Event Flags in an Event Flags Group(cont.)

  13. Getting Event Flags from an Event Flags Group • tx_event_flags_get • input parameter • group_ptr • requested_flags • get_option TX_AND TX_AND_CLEAR TX_OR TX_OR_CLEAR • wait_option • The service “gets”, or waits on event flags from an event flags group.

  14. Getting Event Flags from an Event Flags Group(cont.)

  15. Getting Event Flags from an Event Flags Group(cont.) • TX_AND_CLEAR Current event flags group Value: 0x537 0000 0000 0000 0000 0000 0101 0011 0111 Flags to get Value: 0x111 0000 0000 0000 0000 0000 0001 0001 0001 New current event flags group Value: 0x426 0000 0000 0000 0000 0000 0100 0010 0110

  16. Getting Event Flags from an Event Flags Group(cont.)

  17. Deleting an Event Flags Group • tx_event_flags_delete • input parameter • group_ptr • The service deletes an event flags group. • When a group is deleted , all threads suspended on it resume and receive a TX_DELETED.

  18. Deleting an Event Flags Group(cont.)

  19. Retrieving Information about an Event Flags Group • tx_event_flags_info_get • input parameter • group_ptr • output parameters • current_flags • first_suspended • suspended_count • next_group • The service retrieves several useful items of information about an event flags group.

  20. Retrieving Information about an Event Flags Group(cont.)

  21. Retrieving Information about an Event Flags Group(cont.)

  22. Sample System Using an Event Flags Group to Synchronize Two Threads

  23. Sample System Using an Event Flags Group to Synchronize Two Threads(cont.)

  24. Sample System Using an Event Flags Group to Synchronize Two Threads(cont.)

  25. Sample System Using an Event Flags Group to Synchronize Two Threads(cont.)

  26. Sample System Using an Event Flags Group to Synchronize Two Threads(cont.)

  27. Sample System Using an Event Flags Group to Synchronize Two Threads(cont.)

  28. Event Flags Group Internals

  29. THE END

More Related