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

正文內(nèi)容

tornadovxworks培訓-文庫吧

2025-07-29 14:26 本頁面


【正文】 able) 嵌入式培訓專題 微迪軟件培訓中心 混合調(diào)度策略 時間片t4t2 t3t2t1t3t2t1高低時 間先優(yōu)級注: 表示搶占, 表示任務完成。嵌入式培訓專題 微迪軟件培訓中心 內(nèi)核時間片 ? 時間片的長度可由系統(tǒng)調(diào)用 KernelTimeSlice(ticks) 通過輸入?yún)?shù)值來指定。 當 ticks為 0時,時間片調(diào)度被關(guān)閉 ? 基于優(yōu)先級的搶占式調(diào)度可以發(fā)生在任何時候,時間片輪轉(zhuǎn)調(diào)度只能在相同優(yōu)先級的任務間每隔 ticks發(fā)生一次。 ? 在 VxWorks系統(tǒng)中,可以調(diào)用函數(shù) kernelTimeSlice來使用時間片輪轉(zhuǎn)調(diào)度。 嵌入式培訓專題 微迪軟件培訓中心 VxWorks任務特性 ? 所有的代碼運行在同一地址空間。 ? 任務能快速共享系統(tǒng)的絕大部分資源,同時有自己獨立的上下文 ? 所有的任務都運行在特權(quán)模式下 嵌入式培訓專題 微迪軟件培訓中心 共享代碼和重入(一) ? VxWorks提倡單個子程序或子程序庫被多個不同的任務調(diào)用。例如 printf。一個被多個任務調(diào)用的單個拷貝稱為共享代碼。 ? VxWorks動態(tài)鏈接功能很容易實現(xiàn)代碼共享。 ? 共享代碼必須是可重入的。 ? VxWorks的 I/O和驅(qū)動程序是可重入的。但是要求應用小心設計。對于緩沖( buffer)I/O,VxWorks推薦使用文件指針。 嵌入式培訓專題 微迪軟件培訓中心 共享代碼和重入(二) ? 大部分 VxWorks程序使用下面的重入機制 – 動態(tài)堆棧變量 ? 如果程序僅僅是純代碼,除了自己的動態(tài)堆棧變量外沒有自己的數(shù)據(jù),除了調(diào)用者以參數(shù)傳進的數(shù)據(jù)外,沒有其他數(shù)據(jù)。任務只在自己的堆棧內(nèi)進行操作。 – 由信號量保護的全局或靜態(tài)變量 ? VxWorks的一些庫封裝對公共數(shù)據(jù)的訪問。需要借用互斥機制 – 任務變量 ? 一些程序可能會被多個任務同時調(diào)用,這些任務可能要求全局變量和靜態(tài)變量有不同的值。這種情況下, VxWorks提供了所謂任務變量的機制,這種機制允許在任務上下文中增加 4字節(jié)的變量,因此每次上下文交換時,改變量的值被保存。 ? 這種機制由 taskVarLib庫中的函數(shù)來提供。 嵌入式培訓專題 微迪軟件培訓中心 搶占禁止 ? Wind內(nèi)核可通過調(diào)用 taskLock()和 taskUnlock() 來使調(diào)度器起作用和失效。當一個任務調(diào)用 taskLock()使調(diào)度器失效,任務運行時沒有基于優(yōu)先級的搶占發(fā)生。然而,如果任務被阻塞或是懸置時,調(diào)度器從就緒隊列中取出最高優(yōu)先級的任務運行。當設置搶占禁止的任務解除阻塞,再次開始運行時,搶占又被禁止。這種搶占禁止防止任務的切換,但對中斷處理不起作用。 嵌入式培訓專題 微迪軟件培訓中心 POSIX調(diào)度 ? schedPxLib庫提供了 POSIX ? POSIX和 Wind調(diào)度差異 – POSIX調(diào)度算法應用在進程到進程基礎之上的,而 Wind調(diào)度算法則用于整個系統(tǒng)基礎之上的,所有任務即可以使用輪轉(zhuǎn)調(diào)度,也可以使用基于優(yōu)先級的搶占調(diào)度。 – POSIX的優(yōu)先級編號方案與 Wind的方案相反。 POSIX中,優(yōu)先數(shù)越高,優(yōu)先級越高; Wind方案相反。為了解決這種沖突,用戶需要通過將默認的全局變量 posixPriorityNumbering的設置改委 FALSE。 – 使用 POSIX調(diào)度程序,需要在配置 VxWorks時,包含INCLUDE_POSIX_SCHED宏定義,系統(tǒng)將自動包含 POSIX調(diào)度程序。 嵌入式培訓專題 微迪軟件培訓中心 VxWorks怎樣滿足實時性需求 ? 多任務特性 ? 基于搶占式多任務調(diào)度 ? 快速的任務上下文切換 ? 快速確定的系統(tǒng)響應 ? 高效的任務間通訊機制 嵌入式培訓專題 微迪軟件培訓中心 RealTime Multitasking Introduction Task Basics Task Control Error Status System Tasks 嵌入式培訓專題 微迪軟件培訓中心 Overview Low level routines to create and manipulate tasks are found in taskLib. Do not confuse executable code with the task(s) which execute it. A VxWorks task consists of: A stack (for local storage of automatic variables and parameters passed to routines). A TCB (for OS control) Code is downloaded before tasks are spawned. Several tasks can execute the same code (., printf()). 嵌入式培訓專題 微迪軟件培訓中心 Creating a Task taskSpawn Stack TCB PC foo () { ... } 嵌入式培訓專題 微迪軟件培訓中心 Creating a Task int taskSpawn (name, priority, options, stackSize, entryPt, arg1, ..., arg10) name Task name, if NULL gives a default name. priority Task priority, 0255. options Task options . VX_UNBREAKABLE. stackSize Size of stack to be allocated in bytes. entryPt Address of code to start executing (initial PC) arg1, ..., arg10 Up to 10 arguments to entry point routine. Returns a task id or ERROR if unsuccessful. 嵌入式培訓專題 微迪軟件培訓中心 Task ID?s Efficient 32bit handle for task. Assigned by kernel when task is created. May be reused after task exists. A task id of zero refers to task making call (self). Relevant taskLib routines: taskIdSelf() Get ID of calling task. taskIdListGet() Fill array with ID?s of all existing tasks. taskIdVerify() Verify a task ID is valid. Unique to each task. 嵌入式培訓專題 微迪軟件培訓中心 Task Names Provided for human convenience. Typically used only from the shell (during development). Within programs, use task Ids. By convention, start with a t. Default is an ascending integer following a t. Promotes interpretation as a task name. Doesn?t have to be unique (but usually is). Relevant taskLib routines. taskName() Get name from tid. taskNameToId() Get tid from task name. 嵌入式培訓專題 微迪軟件培訓中心 Task Priorities Range from 0 (highest) to 255 (lowest). No hard rules on how to set priorities. There are two (often contradictory) “rules of thumb”: Shorter deadline = higher priority. More important = higher priority. Can manipulate priorities dynamically with: taskPriorityGet (tid, amp。priority) taskPrioritySet (tid, priority) 嵌入式培訓專題 微迪軟件培訓中心 Task Stacks Allocated from memory pool when task is created. Fixed size after creation. The kernel reserves some space from the stack, making the stack space actually available slightly less than the stack space requested. Exceeding stack size (“stack crash”) causes unpredictable system behavior. 嵌入式培訓專題 微迪軟件培訓中心 Stack Overflows Press the checkstack button: To check for a stack overflow use the Browser. Examine the highwater mark indicator in the stack display window. Highwater Mark Indicator (UNIX) Note: In the PC Browser Stack Check Window, the high water makr triangles are not present. Instead, the number displayed inside each stack bar is that stack?s high water mark. The filled portion of the bar indicates the current stack usage graphically. 嵌入式培訓專題 微迪軟件培訓中心 Task Options Can be bitwise or?ed together when the task is created. VX_FP_TASK Add floating point support. VX_NO_STACK_FILL Don?t fill stack with 0xee?s. VX_UNBREAKABE Disable breakpoints. VX_DEALLOC_STACK Deallocate stack and TCB when task exists (automatically set for you). Use taskOptionsGet() to inquire about a task?s options. Use taskOptionsSet() to unset VX_DEALLOC_STACK. 嵌入式培訓專題 微迪軟件培訓中心 Task Creation During time critical code, task creation can be unacceptably time consuming. To reduce creation time, a task can be spawned with the VX_NO_STACK_FILL option bit set. Alternatively, spawn a task at system startup, which blocks immediately, and waits to be made ready when needed. 嵌入式培訓專題 微迪軟件培訓中心 Task Deletion Deletes the specified task. Deallocates the TCB and stack. Analogous to a taskDelete() of self. exit (code) code parameter gets stored in the TCB field exitCode. TCB may be examined for postmort
點擊復制文檔內(nèi)容
教學課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1