freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

tornadovxworks培訓(xùn)(完整版)

  

【正文】 調(diào)用 KernelTimeSlice(ticks) 通過(guò)輸入?yún)?shù)值來(lái)指定。 ? 共享代碼必須是可重入的。這種情況下, VxWorks提供了所謂任務(wù)變量的機(jī)制,這種機(jī)制允許在任務(wù)上下文中增加 4字節(jié)的變量,因此每次上下文交換時(shí),改變量的值被保存。 – POSIX的優(yōu)先級(jí)編號(hào)方案與 Wind的方案相反。 } … pMem=malloc(sizeof(myStruct))。 default: startEmergProc ()。 =0時(shí), ; 0時(shí), 的個(gè)數(shù); 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 PV原語(yǔ)(一) ? 對(duì)一個(gè)信號(hào)量變量可以進(jìn)行兩種原語(yǔ)操作: p操作和 v操作,定義如下: procedure p(var s:samephore)。將 1時(shí),可以用來(lái)實(shí)現(xiàn)進(jìn)程的互斥。 } Task may need to wait for an event to occur. Busy waiting (., polling) is inefficient. Pending until the event occurs is better. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 The Synchronization Solution Create a binary semaphore for the event. Full (event has occurred). Binary semaphores exist in one of two states: Empty (event has not occurred). Task waiting for the event calls semTake(), and blocks until semaphore is given. Task or interrupt service routine detecting the event calls semGive(), which unblocks the waiting task. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Binary Semaphores SEM_ID semBCreate (options, intialState) options Sepcify queue type (SEM_Q_PRIORITY or SEM_Q_FIFO) for tasks pended on this semaphore. initialState Initialize semaphore to be available (SEM_FULL) or unavailable (SEM_EMPTY). Semaphores used for synchronization are typically initialized to SEM_EMPTY (event has not occurred). Returns a SEM_ID, or NULL on error. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Taking a Semaphore STATUS semTake (semId, timeout) semId The SEM_ID returned from semBCreate(). timeout Maximum time to wait for semaphore. Value can be clock ticks, WAIT_FOREVER, or NO_WAIT. Can pend the task until either Semaphore left unavaiable. Semaphore is given or Timeout expires. Returns OK if successful, ERROR on timeout (or invalid semId). 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Taking a Binary Semaphore semaphore available ? task pends until sem is given or timeout timeout task unpends semTake() returns ERROR no task continues semTake() returns OK yes task unpends, semTake() returns OK semaphore given 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Giving a Semaphores STATUS semGive (semId) Unblocks a task waiting for semId. If no task is waiting, make semId available. Returns OK, or ERROR if semId is invalid. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Giving a Binary Semaphore tasks pended ? semaphore made available no task at front of queue made ready semaphore remains unavailable yes 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Information Leakage Fast event occurrences can cause lost information. Suppose a VxWorks task (priority=100) is executing the following code, with semId initially unavailable: FOREVER { semTake (semId, WAIT_FOREVER)。 7 myBuf [myBufIndex] = ch。 19 myBuf[myBufIndex] = ch。當(dāng)被保護(hù)的任務(wù)完成臨界區(qū)操作以后,它將取消刪除保護(hù)以使自己可以被刪除,從而解阻塞刪除任務(wù)。這種情況可能會(huì)持續(xù)阻塞 T1等待一段不可確定的時(shí)間。 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Priority Inheritance Priority inheritance algorithm solves priority inversion problem. Task owning a mutex semaphore is elevated to priority of highest priority task waiting for that semaphore. Enabled on mutex semaphore by specifying the SEM_INVERSION_SAFE option during semMCreat( ). Must also specify SEM_Q_PRIORITY (SEM_Q_FIFO is inpatible with SEM_INVERSION_SAFE). 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Priority Inversion Safety High Priority Medium Priority Low Priority Pended tHigh unblocks tMediumunblocks semTake( ) Pended Pend Ready semTake( ) Critical Region Ready time semGive( ) 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Avoiding Mistakes It is easy to miuse mutex semaphores, since you must protect all accesses to the resource. To prevent such a mistake Write a library of routines to access the resource. Initialization routine creates the semaphore. Routines in this library obtain exclusive access by calling semGIve( ) and semTake( ). All uses of the resource are through this library. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Caveat Deadlocks A deadlock is a race condition associated with the taking of multiple mutex semaphores. Very difficult to detect during testing. INT 6 INT 3 tExcTask tLogTask tEvtTask tWdbTask tNetTask tTaskHi tTaskLow tPortmapd tWvSvc u0 idle semTake(semId1,1) semTake(semId1,1) semTake(semId2,1) semTake(semId2,1) 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Other Caveats Mutual exclusion semaphores can not be used at interrupt time. This issue will be discussed later in the chapter. Keep the critical region (code between semTake( ) and semGive( )) short. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Common Routines Additional semaphore routines : semDelete( ) Destroy the ( ) calls for all tasks pended on the semaphore return ERROR. show( ) Display semaphoreinformatio。 ? 互斥信號(hào)量有一個(gè)選項(xiàng)允許實(shí)現(xiàn)優(yōu)先級(jí)繼承的算法。 ? T1, T2和 T3分別是高、中、低優(yōu)先級(jí)的任務(wù)。 21 } 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Deletion Safety Deleting a task which owns a semaphore can be catastrophic. data structures left inconsistent. semaphore left permanently unavailable. The deletion safety option prevents a task from being deleted while it owns the semaphore. Enabled for mutex semaphores by specifying the SEM_DELETE_SAFE option during semMCreate( ). 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 安全刪除 ? wind內(nèi)核提供防止任務(wù)被意外刪除的機(jī)制。 call semGive() when done. semTake() will block until the semaphore (and hence the resource) bees available. semGive() releases the semaphore (and hence access to the resource). 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Creating Mutual Exclusion Semaphores SEM_ID semMCreate (options) options can be : queue specification SEM_Q_FIFO or SEM_Q_PRIORITY deletion safety SEM_DELETE_SAFE priority inheritance SEM_INVERSION_SAFE Initial state of semaphore is available. 嵌入式培訓(xùn)專題 微迪軟件培訓(xùn)中心 Mutex Ownership A task which takes a mutex semaphore “owns” it, so that no other task can give this semaphore. Mutex semaphores can be taken recursively. The task which owns the semaphore may take it more tha
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1