亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2486 | 回復(fù): 3
打印 上一主題 下一主題

A Device Driver for Shared Queues with Timestamping [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-02-14 22:24 |只看該作者 |倒序瀏覽
以我的理解,大致是寫一個共享隊列讀寫的module,加兩個字符設(shè)備,然后用一個多線程的測試應(yīng)用去測試。如果有理解不對的地方請指正。主要不太明白的地方有timestamp和這個token,token id如何實現(xiàn)。希望前輩給講解一下。謝謝
(希望似懂非懂的童鞋不要用很確定的語氣講,容易誤導(dǎo)其他人,謝謝)

Assignment Objectives
1. To learn the basic programming technique for module and device driver in Linux kernel.
2. To learn thread programming in Linux.
3. To access RTC module in x86 architecture.
Project Assignment
In this assignment, your team is required to develop
1. A device driver for shared queues which perform the basis enqueue and dequeue operations and record the time of the operations.
2. A test program that initiates multiple threads to access the shared queues.
When the device driver is installed, two queue devices, named “Tqueue1” and “Tqueue2”, will be created and added to Linux device file systems. The two devices act as FIFO (first-in-first-out) queues where tokens can be enqueued and dequeued. Each token is represented by token id which is an integer. Each queue can be shared by multiple tasks (processes or threads) concurrently and should be implemented as a ring buffer of size 5. The device driver should implement the following file operations:
• open: to open a device (either Tqueue1 or Tqueue2)
• write: to enqueue a token to the device. The time of enqueue should be attached to the token and saved in the queue device. If the queue is full, -1 will be returned.
• read: to dequeue a token from the device. The data returned includes token id, arrival timestamp, and departure timestamp. If the queue is empty, -1 will be returned.
• release: to release the file structure.
Timestamp is a struct of 3 bytes for hour, minute, and second. It can be read from the real-time clock module of Intel I/O controller hub ICH8.
In the test program, you will create 6 threads:
• Two sender threads, sender1 and sender2, which create one token at a time and enqueue it to Tqueue1. They then take a nap (sleep) for a random interval before sending the next token. If an enqueue operation fails, the sender retries it after a nap. When a taken is created, it is assigned with a global sequence number as the token id.
• Two router threads, router1 and router 2, which repeat the operations of dequeuing a taken from Tqueue1, printing out the token id and the timestamps, sending the taken to Tqueue 2, and taking a nap. If either dequeue or enqueue operations fail, the router retries the operation after a nap.
• Two receiver thread, receiver1 and receiver2, which repeat the operations of dequeuing a taken from Tqueue2, printing out the token id and the timestamps, and taking a nap. If a dequeue operation fails, the receiver retries the operation after a nap.
All threads exit after completing the operations for 100 tokens. The time for a nap is an interval distributed randomly between 100ms and 500ms.

論壇徽章:
0
2 [報告]
發(fā)表于 2011-02-15 22:22 |只看該作者
怎么沒人幫助一下呢?

論壇徽章:
0
3 [報告]
發(fā)表于 2011-02-16 00:12 |只看該作者
這個是哪里來的?

論壇徽章:
0
4 [報告]
發(fā)表于 2011-02-16 21:15 |只看該作者
這個是哪里來的?
chobit_s 發(fā)表于 2011-02-16 00:12



    別人的作業(yè) 。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP