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

正文內(nèi)容

tornadovxworks培訓(xùn)(文件)

 

【正文】 kes 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)專(zhuā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)專(zhuā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)專(zhuān)題 微迪軟件培訓(xùn)中心 Common Routines Additional semaphore routines : semDelete( ) Destroy the ( ) calls for all tasks pended on the semaphore return ERROR. show( ) Display semaphoreinformatio。當(dāng)執(zhí)行完成,任務(wù)釋放該資源并返回到它正常的或標(biāo)準(zhǔn)的優(yōu)先級(jí)。 ? 互斥信號(hào)量有一個(gè)選項(xiàng)允許實(shí)現(xiàn)優(yōu)先級(jí)繼承的算法。畢竟資源是不可被搶占的。 ? T1, T2和 T3分別是高、中、低優(yōu)先級(jí)的任務(wù)。而且,假想任務(wù)沒(méi)有機(jī)會(huì)釋放該資源,那麼現(xiàn)在其他任何任務(wù)現(xiàn)在就不能獲得該資源,資源被凍結(jié)了。 21 } 嵌入式培訓(xùn)專(zhuā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)專(zhuān)題 微迪軟件培訓(xùn)中心 安全刪除 ? wind內(nèi)核提供防止任務(wù)被意外刪除的機(jī)制。 13 } 14 15 void myBufPut (char ch) 16 { 17 semTake(mySemId, WAIT_OREVER)。 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)專(zhuā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)專(zhuā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 than once. Must be given same number of times as taken before it will be released. Mutual exclusion semaphores cannot be used in an interrupt service routine. 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Taking a Mutex Semaphore owner of Semaphore? task pends until sem is given or timeout another task task continues semTake() returns OK Task bees owner no one task continues semTake() returns OK task ownership count incremented this task 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Giving a Mutex Semaphore ownership count? semaphore made available one semGive() returns ERROR not owner greater than one tasks pended? no decrement ownership count task at head of queue is made ready, bees owner yes 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Code Example Solution 1 include ”” 2 include ” ” 3 4 LOCAL char myBuf[BUF_SIZE]。 /* store data here */ 2 int myBufIndex = 1。 } What would happen in the scenarios below ? 1. repeat (1, semGive, semId)。 waitForData ()。如果將信號(hào)量看作共享變量,則 pv操作為其臨界區(qū),多個(gè)進(jìn)程不能同時(shí)執(zhí)行,一般用硬件方法保證。 } 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 PV原語(yǔ)(二) ? 其中用到兩個(gè)標(biāo)準(zhǔn)過(guò)程: asleep()。 if (0) asleep()。 end。 ? 信號(hào)量作為任務(wù)間同步和互斥的機(jī)制,是快速和高效的,它們除了被應(yīng)用在開(kāi)發(fā)設(shè)計(jì)過(guò)程中外,還被廣泛地應(yīng)用在 VxWorks 高層應(yīng)用系統(tǒng)中。 case S_rctorLib_LEAK_POSSIBLE: checkVessel ()。 } ... } 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Examining Errno Examine errno to find out why a routine failed. if (reactorOk() == ERROR) { switch (errno) { case S_rctorLib_TEMP_DANGER_ZONE: startShutDown ()。 ... } STATUS taskDelay (ticks) Use sysClkRateSet() to change the clock rate. Accurate only if clock rate is a multiple of seven ticks / seconds. Can suffer from “drift.” 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Reentrancy and Task Variables If tasks access the same global or static variables, the resource can bee corrupted (called a race condition). Possible Solutions: Task Variables cause a 32bit value to be saved and restored on context switchs, like a register. Use only stack variables in applications. Protect the resource with a semaphore. Use task variables to make the variable private to a task Caveat: task variables increase context switch times. See the taskVarLib manual pages for details. 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Task Hooks Userdefined code can be executed on every context switch, at task creation, or at task deletion: taskSwitchHookAdd () taskCreateHookAdd () taskDeleteHookAdd () VxWorks uses a switch hook to implement task variables. See manual pages on taskHookLib for details. 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Task Information Like i(), but also displays: Can also use show (): show (tNetTask, 1) Stack information Task options CPU registers FPU registers (if the VX_FP_TASK option bit is set) ti (taskNameOrId) 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 Task Browser To obtain information about a specific task, click on the task?s summary line in the main target browser. 嵌入式培訓(xùn)專(zhuān)題 微迪軟件培訓(xùn)中心 What is POSIX ? Originally, an IEEE mittee convened to create a standard interface to UNIX for: VxWors supports almost all of the POSIX Realtime Extensions. Increased portability. Convenience. Context switch times are very fast. Text, data, and bss are stored in a mon, global address space. The POSIX realtim
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1