« Home « Chủ đề Định thời biểu CPU

Chủ đề : Định thời biểu CPU


Có 120+ tài liệu thuộc chủ đề "Định thời biểu CPU"

Real-Time Embedded Multithreading Using ThreadX and MIPS- P2

tailieu.vn

064 tx_byte_pool_create( &. my_byte_pool, “my_byte_pool”, 065 fi rst_unused_memory,. 066 DEMO_BYTE_POOL_SIZE);. Speedy_Thread, “Speedy_Thread”, 077 Speedy_Thread_entry, 0,. Entry function defi nition of the “Speedy_Thread”. Entry function defi nition of the “Slow_Thread”. inter-thread mutual exclusion stack kernel entry suspension memory byte pool template. You will need to add several variables and perform several computations in each of the two thread entry functions. Modify...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P3

tailieu.vn

Figure 4.9 contains the attributes of an application timer. Other attributes include the name of the expiration function that is executed when the timer expires.. Location of memory block pool Total number of bytes available. Figure 4.8 : Attributes of a memory block pool. the use of the developer.) An attribute containing the initial number of timer-ticks 1 for the...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P4

tailieu.vn

Figure 6.2: ThreadX vector area. Figure 6.5 shows a typical application main function that uses ThreadX. Figure 6.3: Changing the reset vector. Figure 6.4: ThreadX low-level initialization. ThreadX starts scheduling threads by calling its scheduler, _tx_thread_schedule. ThreadX scheduling occurs within a small loop inside _tx_thread_schedule . This pointer name is _tx_thread_execute_ptr . While this pointer is not NULL, it points...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P5

tailieu.vn

In this fi gure, the line TX_THREAD my_thread;. Recall that TX_THREAD is a data type used to defi ne a TCB. status tx_thread_create. &my_thread Pointer to a thread control block (defined by TX_THREAD. "my_thread". Pointer to the name of the thread—a user-defined name. my_thread_entry Name of the thread entry function. This thread’s stack area is 1,500 bytes in size, starting...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P6

tailieu.vn

In this chapter, we consider the properties of the mutex, which is designed solely to provide mutual exclusion protection by avoiding confl ict between threads and preventing unwanted interactions between threads.. 1 Some writers describe this type of mutex as a recursive mutex because of the same-thread, multiple-ownership capability. In this case, the thread must fi rst obtain a particular...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P7

tailieu.vn

A memory byte pool is a contiguous block of bytes. However, this fl exibility leads to some problems, such as fragmentation of the memory byte pool as groups of bytes of varying sizes are used.. A memory byte pool is similar to a standard C heap. In addition, threads can suspend on a memory byte pool until the requested memory...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P8

tailieu.vn

Each memory block pool is a public resource. The memory area for the block pool is specifi ed during creation, and can be located anywhere in the target’s address space. You can easily manage this memory area by making it a memory block pool.. To accomplish this, the application calls tx_block_pool_prioritize prior to the block release call that lifts thread...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P9

tailieu.vn

10.9 Deleting an Application Timer. The tx_timer_delete service deletes an application timer. Figure 10.10 shows how to delete an application timer.. 10.10 Retrieving Application Timer Information. The fi rst such service for application timers — the tx_timer_pool_info_get service — retrieves a subset of information from the Application Timer Control Block.. One service — the tx_timer_pool_. Delete application timer. Assume that...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P10

tailieu.vn

Figure 11.5 shows how a counting semaphore can be deleted.. If variable status contains the return value TX_SUCCESS, we have successfully deleted the counting semaphore.. 11.8 Getting an Instance of a Counting Semaphore. The tx_semaphore_get service retrieves an instance (a single count) from the specifi ed counting semaphore. Figure 11.6 shows how to get an instance of a counting semaphore,...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P11

tailieu.vn

Event fl ags provide a powerful tool for thread synchronization. Event fl ags can be set or cleared 1 by any thread and can be inspected by any thread. Threads can suspend while waiting for some combination of event fl ags to be set. Event fl ags are arranged in groups of 32 as illustrated by Figure 12.1. Threads can...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P12

tailieu.vn

We arbitrarily set the event fl ags group to the value slow_fl ags in the preceding statement.. We could have set the event fl ags group to the value speedy_fl ags, thereby giving Slow_Thread the fi rst opportunity to execute.. We need to change all references to a binary semaphore with references to an event fl ags group.. Most of...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P13

tailieu.vn

If return variable status contains the value TX_SUCCESS, we have retrieved valid information about the message queue.. 13.11 Prioritizing a Message Queue Suspension List. message queue at the front of the suspension list. TX_QUEUE my_queue;. TX_QUEUE *next_queue;. Retrieve information about the previously created message queue "my_queue.". Figure 13.11: Retrieving information about a message queue. Figure 13.12: Effect of prioritizing a...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P14

tailieu.vn

In addition to the actual data for the event, the protected memory must store the priority and time of the event’s occurrence.. Figure 14.7 summarizes the event overwrite rules.. Figure 14.6: Protected memory. Figure 14.7: Event overwrite rules. 14.4 Design of the System. 14.4.1 Thread Design. Figure 14.8 depicts this thread.. We need a thread to coordinate the capture and...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P15

tailieu.vn

void event_recorder_process(ULONG thread_input). ULONG frame, event_priority, event_time, index, frame_data[2];. Copy an event from temporary memory to protected memory. from temp_memory to protected_memory. Store event time and event priority in protected memory. frame = frame_data[0];. event_priority = frame_data[1];. protected_memory[event_count][0. protected_memory[event_count][1. protected_memory[event_count][index+2. temp_memory[frame][1];. Store the event time and priority in the next available position in protected memory.. Store the 24 seconds of...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P16

tailieu.vn

This service initializes the Memory Block Pool Control Block through the parameter pool_ptr.. pool_ptr Pointer to a Memory Block Pool Control Block.. name_ptr Pointer to the name of the memory block pool.. pool_start Starting address of the memory block pool.. pool_size Total number of bytes available for the memory block pool.. TX_SUCCESS 2 (0 x 00) Successful memory block pool...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P17

tailieu.vn

The event fl ags group services described in this appendix are:. tx_event_fl ags_create Create an event fl ags group tx_event_fl ags_delete Delete an event fl ags group. tx_event_fl ags_performance info_get Get event fl ags group performance information. tx_event_fl ags_performance_system_info_get Retrieve performance system information. tx_event_fl ags_create. Create an event fl ags group Prototype. UINT tx_event_fl ags_create ( TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr)....

Real-Time Embedded Multithreading Using ThreadX and MIPS- P18

tailieu.vn

The mutex services described in this appendix include:. tx_mutex_create Create a mutual exclusion mutex. tx_mutex_delete Delete a mutual exclusion mutex. tx_mutex_get Obtain ownership of a mutex. tx_mutex_info_get Retrieve information about a mutex tx_mutex_performance_info_get Get mutex performance information tx_mutex_performance_system_info_get Get mutex system performance. tx_mutex_prioritize Prioritize the mutex suspension list. tx_mutex_put Release ownership of a mutex. tx_mutex_create. UINT tx_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr,...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P19

tailieu.vn

This service deletes the specifi ed message queue. queue_ptr Pointer to a previously created message queue’s Control Block.. TX_SUCCESS 2 (0x00) Successful message queue deletion.. TX_QUEUE_ERROR (0x09) Invalid message queue pointer.. TX_QUEUE my_queue;. Delete entire message queue. Assume that the queue has already been created with a call to tx_queue_create. status tx_queue_delete( &. If status equals TX_SUCCESS, the message queue...

Real-Time Embedded Multithreading Using ThreadX and MIPS- P20

tailieu.vn

TX_SEMAPHORE_ERROR (0x0C) Invalid semaphore pointer. TX_SEMAPHORE my_semaphore;. status tx_semaphore_create( &. tx_semaphore_delete. UINT tx_semaphore_delete (TX_SEMAPHORE *semaphore_ptr). This service deletes the specifi ed counting semaphore. semaphore_ptr Pointer to a previously created semaphore’s Control Block.. TX_SEMAPHORE_ERROR (0x0C) Invalid counting semaphore pointer.. status tx_semaphore_delete( &. tx_semaphore_get. UINT tx_semaphore_get( TX_SEMAPHORE *semaphore_ptr, ULONG wait_option). As a result, the specifi ed semaphore’s count is decreased by one....

Real-Time Embedded Multithreading Using ThreadX and MIPS- P21

tailieu.vn

status tx_thread_entry_exit_notify( &. if (condition TX_THREAD_ENTRY. tx_thread_create, tx_thread_delete, tx_thread_entry_exit_notify, tx_thread_identify, tx_. thread_info_get, tx_thread_performance_info_get, tx_thread_performance_system_info_. get, tx_thread_preemption_change, tx_thread_priority_change, tx_thread_relinquish, tx_thread_reset, tx_thread_resume, tx_thread_sleep, tx_thread_stack_error_notify, tx_thread_suspend, tx_thread_terminate, tx_thread_time_slice_change,. tx_thread_wait_abort. tx_thread_identify. TX_THREAD* tx_thread_identify (VOID). This service returns a pointer to the currently executing thread’s Control Block. thread pointer Pointer to the currently executing thread’s Control Block. TX_THREAD *my_thread_ptr;. my_thread_ptr tx_thread_identify();. tx_thread_info_get. UINT tx_thread_info_get( TX_THREAD...