91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

EECS 3221代做、代寫c/c++設計編程

時間:2024-05-06  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



LE/EECS **21 – Operating System Fundamentals
Winter 2024—Section N
Programming Assignment 2
Submission Deadline: March 28, 2024 before 16:59
Objectives
In this assignment we will try to practice the concepts such as: multithreading, synchronization with
semaphores, deadlocks and starvation.
Permitted similarity threshold for this assignment is 70%.
General Assignment Notes
When writing and submitting your assignments follow these requirements:
• Name your source code file as: your YorkU student number, an underscore, 'a' (for 'assignment',
then the assignment number in two digits. For example, if the user 100131001 submits Assignment
2, the name should be: 100131001_a02.c.txt. No other file name format will be accepted. We
require the .txt extension in the end because eClass does not allow .c extension.
• Use the same naming scheme for the assignment title when submitting the assignment to the
eClass; do not add “.c.txt” in the title.
• For this assignment you must use C99 language syntax. Your code must compile using make
without errors and warnings. You are provided with a makefile and instructions on how to use
it. If you use that makefile to compile the code, then you don’t have to do anything special to select
C99. The makefile that we have provided doesn’t let your program compile if there are warnings;
hence, make sure no warnings or errors at all.
• Test your program thoroughly with the gcc compiler in a Linux environment. Make you’re
your gcc version is at least the same as university red servers. This can be verified by running the
command “gcc --version” in Linux shell.
• If your code does not compile, then you will get zero. Therefore, make sure that you have removed
all syntax errors from your code.
Marks will be deducted from any question(s) where these requirements are not met.
WARNING
Follow the assignment instructions to the letter in terms of the file names and function names, as
this assignment will be auto graded. If anything is not as per description, the auto grading will fail, and
your assignment will be given a mark of 0.
You program must terminate normally on the provided test case; if it does not terminate normally then
auto-grader will get empty output and it will be awarded zero.
Synopsis
In this assignment, our process will create multiple threads at different times. These threads may have
different start_time but there is no lifetime. Each thread after its creation runs a small critical section
and then terminates. All threads perform same action/code. Most of the code such as reading the input
file, creating the threads etc. is provided. Your task is to implement following synchronization logic with
the help of POSIX pthreads and semaphores:
• Only one thread can be in its critical section at any time in this process.
• The first thread, in terms of creation time, enters first in its critical section.
• After that threads are permitted to perform their critical section based on their ID.
o Threads are given IDs in the format txy where x and y are digits (0-9). Thread IDs are
unique. Threads may have same or different start_time. Thread entries in the input file can
be in any order.
o The “y” in thread IDs thus will either be an even digit or odd digit.
o After the first thread, the next thread that will be permitted to perform its critical section
must be the one in which “y” is different i.e. if “y” was even in first thread then in the next
it must be odd or vice versa.
o For the rest of the process, you must follow the same scheme i.e. two threads with odd “y”
or even “y” can not perform critical section simultaneously.
• Since synchronization may lead to deadlock or starvation, you have to make sure that your solution
is deadlock free i.e. your program must terminate successfully, and all the threads must perform
their critical section.
• One extended form of starvation will be that towards the end, we have all odd or all even processes
left, and they are all locked because there are no other type (odd/even) of threads left. Once the
process reaches to that stage, you must let them perform their critical section to avoid starvation
and progress towards the end of the process. In the screen shot on the next page, you will notice
that t07, t05 and t01 perform their critical section without any even number thread separating them
because there are no more even number threads left. However, you must make sure that there
are no other threads coming in future which could help avoid this situation. If there is chance
for more threads coming, then you will hold this till then. For example, in the screenshot on
the next page, this started happening at t=20 which is the creation time of the last thread in
our input file.
Description
For this assignment, you are provided a skeleton code in the file student_code.c. Some functions are
completely implemented, and some are partially implemented. Additionally, you can write your own
functions if required. Complete the program as per following details so that we can have functionality as
described in the Synopsis above. Write all the code in single C file. DO NOT forget to rename your C
code file appropriately when submitting:
1. The readFile(), if called with filename and struct thread pointer as arguments, can read the
content of file for you and populate the threads’ information in a dynamic array of type struct
thread. Such a pointer threads is provided there in main() and you can use it. readFile()returns
the number of threads read from the file and you must connect it with the threadCount variable
provided in the main().
2. You may add some more members to struct thread if required. If you want to initialize those
additional members, then you can possibly do that in readFile().
3. The main() already contains some code and hints to guide you. However, there is no call to
readFile() or code to initialize, execute and synchronize threads. You must perform these tasks in
a suitable way there. startClock() invocation as given in main() is required to initiate the
program’s internal clock, so do not remove it.
4. The threadRun() function also contains the code that a thread must run. However, the
synchronization logic (entry/exit section) is missing. Add the suitable code before and after the
critical section.
5. You will need to create and use POSIX pthreads and semaphore(s) to implement the required logic.
6. The image below shows the expected output for the sample input file (sample2_in.txt) provided with
this assignment. In this output when there are multiple threads finishing (or may be starting) at the
same time, e.g. at t=5 both t02 and t07 are finished, then their order may switch and may be different
than their critical section order, because start/finish is out of critical section and unsynchronized.
However, the critical section order, e.g. in t=5 both t02 and t07 perform their critical section, must
always be as per our synchronization requirement. Also, you have to make sure that a thread must
be started at its creation time as per the input file i.e. “is started” message of thread must have the
same time stamp as mentioned in the input file:
7. Do not change the code in the functions: logStart(), logFinish(), startClock(),
getCurrentTime(). Also, do not change the signature of any of the functions that are given in the
code provided.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


















 

掃一掃在手機打開當前頁
  • 上一篇:代寫8PRO102、代做C++程序設計
  • 下一篇:代做CT60A9600、Java/c++程序代寫
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    欧美日韩高清在线一区| 国内精品免费**视频| 日本在线播放一区二区三区| 国产精品一区三区| 国产一区二区三区自拍| 欧美亚洲一区二区在线观看| 欧美国产日韩精品免费观看| 日韩精品欧美精品| 99国产精品久久久久久久久久久| 99www免费人成精品| 日韩欧美一区在线| 亚洲成人av电影| 91蜜桃网址入口| 欧美色精品在线视频| 中文字幕一区二区三区在线观看| 捆绑调教美女网站视频一区| 国一区二区在线观看| 91精品久久久久久久久99蜜臂| 亚洲人妖av一区二区| 国产福利91精品一区| 久久婷婷亚洲| 中文字幕一区在线| 丰满少妇在线播放bd日韩电影| 六月婷婷一区| 综合av第一页| 99在线精品视频| 欧美人xxxx| 香蕉乱码成人久久天堂爱免费| 国产精品www.| 精品欧美久久久| 狠狠色丁香久久婷婷综| 欧美亚洲网站| 《视频一区视频二区| 成人黄色在线视频| 欧美区视频在线观看| 丝袜国产日韩另类美女| 在线日韩av| 国产精品卡一卡二| 欧美影视一区| 精品国产乱码久久久久久闺蜜| 极品销魂美女一区二区三区| 一本色道久久综合亚洲精品按摩| 亚洲精品v日韩精品| 国内激情久久| 日本一区二区久久| 97久久久精品综合88久久| 欧美一区二区高清| 国产乱码一区二区三区| 欧美日韩一卡二卡| 精品一区二区国语对白| 色天天综合久久久久综合片| 亚洲国产美女搞黄色| 夜久久久久久| 亚洲影视资源网| 国产一区白浆| 亚洲日本va在线观看| 亚洲激情自拍| 亚洲卡通欧美制服中文| 一区二区三区欧美成人| 一区二区在线观看免费视频播放| 亚洲人人精品| 夜夜揉揉日日人人青青一国产精品 | 亚洲一区日韩在线| 亚洲国产一二三| 老司机午夜免费精品视频 | 欧美日韩dvd在线观看| 久久 天天综合| 欧美一卡2卡3卡4卡| 成人免费不卡视频| 久久精品亚洲精品国产欧美kt∨ | 亚洲乱码日产精品bd| 国产一区二区高清视频| 亚洲国产精品一区二区久久| 久久这里有精品15一区二区三区| 日本成人中文字幕在线视频 | 欧美承认网站| 亚洲理论在线观看| 精品国产乱子伦一区| 国产91丝袜在线18| 久久精品在这里| 亚洲激情精品| 视频一区国产视频| 8x福利精品第一导航| 99国产精品国产精品久久| 国产精品女同互慰在线看| 国产欧美短视频| 蜜桃av一区二区| 精品久久人人做人人爱| 亚洲图色在线| 日韩中文字幕不卡| 日韩美女一区二区三区四区| 欧美日韩精品免费看| 亚洲777理论| 欧美一级久久久久久久大片| 欧美日韩综合| 欧美aaa在线| 精品美女在线观看| 一本色道久久综合亚洲精品不| 麻豆91在线看| 欧美国产综合色视频| 久久久一本精品99久久精品66| 精品一区二区三区久久久| 国产免费久久精品| 麻豆久久精品| 99精品视频在线播放观看| 一区二区三区高清| 欧美一级精品在线| 国产色综合网| 成人国产在线观看| 亚洲国产精品影院| 精品国产乱码久久久久久牛牛| 亚洲尤物精选| 成人av影院在线| 亚洲成a人片综合在线| 久久亚洲影视婷婷| 色婷婷亚洲综合| 欧美片第1页综合| 久久国产剧场电影| 亚洲欧美色图小说| 日韩三级高清在线| 美女网站久久| 国产一区二区中文字幕免费看| 精品一区二区三区不卡| 中文字幕中文字幕在线一区| 欧美乱熟臀69xxxxxx| 亚洲一区bb| 欧美jizzhd精品欧美巨大免费| 美女视频一区二区三区| 亚洲视频一区二区在线| 精品国产乱码久久久久久牛牛| 一本大道久久精品懂色aⅴ| 欧美精品尤物在线| 国产一级精品在线| 视频一区中文字幕国产| 国产精品女同互慰在线看| 欧美变态tickling挠脚心| 色婷婷久久久综合中文字幕| 亚洲精品1区| 国产精品播放| 色综合天天综合在线视频| 国产精品一区免费视频| 日韩va欧美va亚洲va久久| 亚洲六月丁香色婷婷综合久久| 久久久久久久久97黄色工厂| 91麻豆精品国产综合久久久久久| 媚黑女一区二区| 一区二区三区国产在线| 欧美精品国产| 91一区在线观看| 成人福利视频网站| 国产精品一区二区视频| 伦理电影国产精品| 婷婷久久综合九色综合伊人色| 亚洲欧美日韩在线| 中文字幕制服丝袜成人av | 亚洲国产一区二区精品专区| 欧美91大片| 91年精品国产| 色综合天天做天天爱| 97se亚洲国产综合自在线不卡| 国产69精品一区二区亚洲孕妇 | 亚洲高清在线精品| 亚洲精品成人在线| 亚洲靠逼com| 亚洲精品国产a久久久久久| 亚洲欧洲av在线| 成人欧美一区二区三区黑人麻豆| 久久久国产精品麻豆| 精品久久久久久久久久久久久久久 | 热久久免费视频| 日韩国产精品久久久| 午夜久久久久久电影| 日韩国产一二三区| 久久精品国产99久久6| 久久69国产一区二区蜜臀| 国产一区二区精品久久| 成人永久看片免费视频天堂| 风间由美一区二区三区在线观看| 成人免费看视频| 91麻豆福利精品推荐| 狠狠爱www人成狠狠爱综合网| 狠狠色伊人亚洲综合网站色| 亚洲人成人一区二区三区| 一区二区三区三区在线| 一本大道久久a久久综合| 欧美无乱码久久久免费午夜一区 | 狠狠色综合网| 免费亚洲视频| 欧美三级午夜理伦三级中视频| 欧美美女喷水视频| 久久婷婷综合激情| 国产精品视频线看| 亚洲国产视频a| 久久精品99国产精品日本| 国产成人在线看| 欧美一区二区三区免费看| 99热免费精品| 欧美日韩一区不卡| 国产网站一区二区三区| 国产农村妇女精品|