Đang chuẩn bị liên kết để tải về tài liệu:
Real-Time Embedded Multithreading Using ThreadX and MIPS- P6

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Real-Time Embedded Multithreading Using ThreadX and MIPS- P6:Although the history of embedded systems is relatively short, 1 the advances and successes of this fi eld have been profound. Embedded systems are found in a vast array of applications such as consumer electronics, “ smart ” devices, communication equipment, automobiles, desktop computers, and medical equipment. | CHAPTER 8 Mutual Exclusion Challenges and Considerations 8.1 Introduction On many occasions we need to guarantee that a thread has exclusive access to a shared resource or to a critical section. However several threads may need to obtain these items so we need to synchronize their behavior to ensure that exclusive access can be provided. In this chapter we consider the properties of the mutex which is designed solely to provide mutual exclusion protection by avoiding conflict between threads and preventing unwanted interactions between threads. A mutex is a public resource that can be owned by at most one thread at any point in time. Furthermore a thread and only that same thread can repeatedly1 obtain the same mutex 232-1 times to be exact. However that same thread and only that thread must give up that mutex the same number of times before the mutex becomes available again. 8.2 Protecting a Critical Section A critical section is a code segment in which instructions must be executed in sequence without interruption. The mutex helps in achieving this goal. Consider Figure 8.1 which shows a code segment that is a critical section. To enter this critical section a thread must first obtain ownership of a certain mutex that protects the critical section. Thus when the thread is ready to begin executing this code segment it first attempts to acquire that 1Some writers describe this type of mutex as a recursive mutex because of the same-thread multiple-ownership capability. However we will not use that terminology here. www.newnespress.coml cioHa oaLeHori tii Krxai LerHiaimi Please purchase PDF Split-Merge on www.verypdf. 100 Chapter 8 Thread Code segment Thread Figure 8.1 Mutex protecting a critical section Figure 8.2 Mutexes providing exclusive access to multiple shared resources mutex. After the thread has acquired the mutex it executes the code segment and then relinquishes the mutex. 8.3 Providing Exclusive Access to Shared Resources A mutex can provide exclusive .

TÀI LIỆU LIÊN QUAN