real-time embedded multithreading, using threadx and arm ~ chapter11 ~
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
Real-Time EmbeddedReal-Time EmbeddedMultithreading, Using ThreaMultithreading, Using Threa
dX and ARMdX and ARM~ Chapter11 ~~ Chapter11 ~
學生 學生 : : 曾楓喬曾楓喬指導教授 指導教授 : : 張軒彬張軒彬
OutlineOutline
IntroductionIntroduction Event Flags Group Control BlockEvent Flags Group Control Block Summary of Event Flags Group Control ServicesSummary of Event Flags Group Control Services Sample System Using an Event Flags Group to Sample System Using an Event Flags Group to
Synchronize Two ThreadsSynchronize Two Threads Event Flags Group InternalsEvent Flags Group Internals
IntroductionIntroduction
Event flags provide a powerful tool for thread syncEvent flags provide a powerful tool for thread synchronization.hronization.
Each event flag is represented by a single bit.Each event flag is represented by a single bit. Event flags are arranged in groups of 32.Event flags are arranged in groups of 32.
Event Flags Group Control BlockEvent Flags Group Control Block
The characteristics of each event flags group are fouThe characteristics of each event flags group are found in its Control Block.nd in its Control Block.
Summary of Event Flags Group ConSummary of Event Flags Group Control Servicestrol Services
Creating an Event Flags GroupCreating an Event Flags Group
tx_event_flags_createtx_event_flags_create Fig11.4 Attributes of an event flags groupFig11.4 Attributes of an event flags group
When created, all the event flags of a group are iniWhen created, all the event flags of a group are initialized to zero.tialized to zero.
Event Flags Group Control BlockEvent Flags Group Control Block
Event Flags Group nameEvent Flags Group name
Group of 32 one-bit event flagsGroup of 32 one-bit event flags
Creating an Event Flags Group(conCreating an Event Flags Group(cont.)t.)
Setting Event Flags in an Event Setting Event Flags in an Event Flags GroupFlags Group
tx_event_flags_settx_event_flags_set input parameterinput parameter
group_ptrgroup_ptrflags_to_setflags_to_setset_optionset_option
TX_AND -> clearTX_AND -> clear
TX_OR -> setTX_OR -> set The service sets or clears one or more event flaThe service sets or clears one or more event fla
gs in a group.gs in a group.
Setting Event Flags in an Event FlagSetting Event Flags in an Event Flags Group(cont.)s Group(cont.)
Setting Event Flags in an Event FlagSetting Event Flags in an Event Flags Group(cont.)s Group(cont.)
TX_ORTX_OR Current event flags group Value: 0x00Current event flags group Value: 0x00
0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000
Flags to set Value: 0xFF0CFlags to set Value: 0xFF0C
0000 0000 0000 0000 1111 1111 0000 11000000 0000 0000 0000 1111 1111 0000 1100
New current event flags group Value: 0xFF0CNew current event flags group Value: 0xFF0C
0000 0000 0000 0000 1111 1111 0000 11000000 0000 0000 0000 1111 1111 0000 1100
Setting Event Flags in an Event FlagSetting Event Flags in an Event Flags Group(cont.)s Group(cont.)
TX_ANDTX_AND Current event flags group Value: 0xFF0CCurrent event flags group Value: 0xFF0C
0000 0000 0000 0000 1111 1111 0000 11000000 0000 0000 0000 1111 1111 0000 1100
Flags to set Value: 0x111Flags to set Value: 0x111
0000 0000 0000 0000 0000 0001 0001 00010000 0000 0000 0000 0000 0001 0001 0001
New current event flags group Value: 0x100New current event flags group Value: 0x100
0000 0000 0000 0000 0000 0001 0000 00000000 0000 0000 0000 0000 0001 0000 0000
Setting Event Flags in an Event FlagSetting Event Flags in an Event Flags Group(cont.)s Group(cont.)
Getting Event Flags from an Event FGetting Event Flags from an Event Flags Grouplags Group
tx_event_flags_gettx_event_flags_get input parameterinput parameter
group_ptrgroup_ptr
requested_flagsrequested_flags
get_optionget_option
TX_AND TX_AND_CLEARTX_AND TX_AND_CLEAR
TX_OR TX_OR_CLEARTX_OR TX_OR_CLEAR
wait_optionwait_option The service “gets”, or waits on event flags from an evThe service “gets”, or waits on event flags from an ev
ent flags group.ent flags group.
Getting Event Flags from an Event FGetting Event Flags from an Event Flags Group(cont.)lags Group(cont.)
Getting Event Flags from an Event FGetting Event Flags from an Event Flags Group(cont.)lags Group(cont.)
TX_AND_CLEARTX_AND_CLEAR Current event flags group Value: 0x537Current event flags group Value: 0x537
0000 0000 0000 0000 0000 0101 0011 01110000 0000 0000 0000 0000 0101 0011 0111
Flags to get Value: 0x111Flags to get Value: 0x111
0000 0000 0000 0000 0000 0001 0001 00010000 0000 0000 0000 0000 0001 0001 0001
New current event flags group Value: 0x426New current event flags group Value: 0x426
0000 0000 0000 0000 0000 0100 0010 01100000 0000 0000 0000 0000 0100 0010 0110
Getting Event Flags from an Event FGetting Event Flags from an Event Flags Group(cont.)lags Group(cont.)
Deleting an Event Flags GroupDeleting an Event Flags Group
tx_event_flags_deletetx_event_flags_delete input parameterinput parameter
group_ptrgroup_ptr The service deletes an event flags group.The service deletes an event flags group. When a group is deleted , all threads suspended When a group is deleted , all threads suspended
on it resume and receive a on it resume and receive a TX_DELETEDTX_DELETED..
Deleting an Event Flags Group(conDeleting an Event Flags Group(cont.)t.)
Retrieving Information about an EveRetrieving Information about an Event Flags Groupnt Flags Group
tx_event_flags_info_gettx_event_flags_info_get input parameterinput parameter
group_ptrgroup_ptr output parametersoutput parameters
current_flagscurrent_flagsfirst_suspendedfirst_suspendedsuspended_countsuspended_countnext_groupnext_group
The service retrieves several useful items of informatiThe service retrieves several useful items of information about an event flags group.on about an event flags group.
Retrieving Information about an EveRetrieving Information about an Event Flags Group(cont.)nt Flags Group(cont.)
Retrieving Information about an EveRetrieving Information about an Event Flags Group(cont.)nt Flags Group(cont.)
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threadsoup to Synchronize Two Threads
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threads(cont.)oup to Synchronize Two Threads(cont.)
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threads(cont.)oup to Synchronize Two Threads(cont.)
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threads(cont.)oup to Synchronize Two Threads(cont.)
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threads(cont.)oup to Synchronize Two Threads(cont.)
Sample System Using an Event Flags GrSample System Using an Event Flags Group to Synchronize Two Threads(cont.)oup to Synchronize Two Threads(cont.)
Event Flags Group InternalsEvent Flags Group Internals
THE ENDTHE END