Linux 驱动设计 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 t

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 18:04:40
Linux 驱动设计 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 t

Linux 驱动设计 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 t
Linux 驱动设计
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.

Linux 驱动设计 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 t
自己能做嘛

Linux 驱动设计 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 t 解释一下linux驱动程序结构框架及工作原理 英语翻译Linux as an Embedded Operating System by Jerry EpplinDoes Linux have potential as an embedded operating system?Should vendors of high-end commercial RTOSs quake in their Bruno Maglis?This article assesses Linux's features,robustness,limit linux下驱动函数和驱动测试函数接口是什么,怎么联系到一起 Linux LINUX 英语翻译RT-Linux is simple,providing only a bare minimum of functionality necessary for implementing a real-time system.But this simplicity is to the system designer's benefit.You want to implement the bulk of the application in Linux processes b Linux要关终端的时候出现“There is still a process runing in this terminal.Closing the terminal will kill it.”怎么知道是什么process没有被关闭?怎么解决? 如何设计LED驱动电源 LED电源驱动设计书籍 How can i solve this problem when i install the weblogic in the linux system,i really get this error,i don't how to solve the problem i faced!hope someone can give me some advise thx org.xml.sax.SAXParseException:The root element is required in a wel linux驱动里 mutex_lock(&tty_mutex)有什么作用? No devices listed in setup ini is found in this machine 我在安装视频驱动是出现的 risk being hunted down like a rabid 原文:This is a brief list of all the files in ./linux/Documentation and whatthey contain.If you add a documentation file,please list it here inalphabetical order as well,or risk being hunted down like a rabid d 高刚性直接驱动设计是什么意思? LED驱动电源设计难吗 英语翻译设备在linux内的文件名the file name of the equipment in the linux 英语翻译PM:Where do you acquire this library?It's part of the ASP.NET AJAX,so you can just download it.We do provide it in two distinct pillars.One is as an MSI installer for Windows-based machines.But if I'm working on a Linux machine or a Mac,I