国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

CS-350代寫(xiě)、C++編程語(yǔ)言代做
CS-350代寫(xiě)、C++編程語(yǔ)言代做

時(shí)間:2024-12-09  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



CS-350 - Fundamentals of Computing Systems
Homework Assignment #8 - BUILD
Due on November 14, 2024 — Late deadline: November 16, 2024 EoD at 11:59 pm
Prof. Renato Mancuso
Renato Mancuso
1CS-350 - Fundamentals of Computing Systems::Homework Assignment #8 - BUILD Problem 1
BUILD Problem 1
We now have a server capable of performing non-trivial operations on images! All we have to do now is to
make the server multi-threaded. And yes, we already have the infrastructure to spawn multiple threads. So
what’s missing exactly?
Output File: server_mimg.c
Overview. As mentioned above, the main idea is to allow multple workers to perform operations on images
in parallel. Everything you have developed in BUILD 6 will be reused, but we must make sure that when
multiple worker threads are spawned, the correctness of the operations on the images is still guaranteed.
But what could be jeopardizing the correctness of these operations? Let us consider a concrete case. Imaging
the following sequence of requests queued at the server: (1) Retrieve image A, (2) blur image A, (3) detect
the vertical edges of image A, and (4) send back the result of the operations performed on image A.
With only one worker, the operations are carried out in this sequence and the result sent back to the client is
an image with the cumulative operations (2) and (3) correctly applied to the source image. With 2 workers
(unless we ffx our implementation) we could have worker #1 and #2 working in parallel on operations (1)
and (2) with the result of the operations being some weird mix of the two operations.
In this assignment, the goal is to allow safe multi-threading where the semantics of sequential operations on
the images is preserved even if multiple threads are spawned and operate in parallel. For this task, we will
use semaphores to perform inter-thread synchronization.
Design. One of the main problem that we have to solve is un-arbitrated access to shared data structures.
To verify that there is a problem unless we insert synchronization primitives accordingly, start with your (or
my) solution for HW6, rename it appropriately, and enable spawning more than 1 worker threads.
Then, run the following simple experiment. First, run the client to generate the sequence of operations listed
above with 1 worker thread and look carefully at the output report generated by the client:
./server_mimg -q 100 -w 1 2222 & ./client -I images/ -L 1:R:1:0,0:b:1:0,0:v:1:0,0:T:1:0 2222
You will notice that the ffrst hash reported by the client (9f3363f0249c15163d52e60fd9544c31) is simply
the hash of the original test1.bmp image. The second (and last) hash reported by the client is the hash
(00e4fc4b9c7c71ee2ca3946053f78793) of the blur+vertical edge detection operations applied in sequence
to the image. However, if we increase the number of worker to 2, the ffnal hash will be different! For instance,
when running:
./server_mimg -q 100 -w 2 2222 & ./client -I images/ -L 1:R:1:0,0:b:1:0,0:v:1:0,0:T:1:0 2222
The last hash obtained on the reference machine changes to b59**c2bcb0a64121def911286c706e2, but
might be something else entirely on a different machine. Also in some cases, the server crashes entirely.
To solve the problem, the cleanest way is to introduce semaphore-based synchronization between threads.
In order to deffne a semaphore, you should use the type sem_t deffned in semaphore.h. Before a semaphore
can be used, it must be initialized.
This can be done with the sem_init(sem_t * semaphore, int pshared, unsigned int init_value).
Here, semaphore is pointer to the semaphore to be initialized, pshared can be set to 0, and init_value is
a non-negative initialization value of the semaphore, following the semantics we have covered in class.
Once your semaphore has been correctly initialized (make sure to check for the error value of the sem_init(...)
call!), the wait and signal operations can be performed over it, following the semantics we have discussed
Problem 1 continued on next page. . . 2CS-350 - Fundamentals of Computing Systems::Homework Assignment #8 - BUILD Problem 1 (continued)
in class. To wait on a semaphore, you must use the sem_wait(sem_t * semaphore) call; to signal on a
semaphore, you must use the sem_post(sem_t * semaphore).
Shared Data Structures. Of course, the main question is what data structures must be protected?. Here
is a list of things that can be problematic, but your own implementation could be different, so try to map
the statement below to your own code.
(1) Image Objects: One obvious place to start is to protect the image objects that are registered with
the server and upon which operations are requested by the client. We want to prevent different worker
to simultaneously change the content of an image, so a good idea is to introduce one semaphore per each
registered image! These must be created and/or initialized dynamically at image registration time.
(2) Image Registration Array: Another shared data structure is the global array of registered images.
Concurrent operations over that array is not a good idea, so all the threads will need to synchronize when
trying to access that shared data structure.
(3) Connection Socket: What? The connection socket has always been shared, so why is that a problem
now? The truth is that it has always been a problem, but we did not care because the responses from
the workers to the client were always a one-shot send(...) operation. But now, there are cases where the
server follows a two-step approach in the protocol it follows with the client. For instance, when handling an
IMG_RETRIEVE operation, a worker ffrst provides a positive acknowledgment of completed request and then
the payload of the image being retrieved. What if another worker starts sending other data while a retrieve
operation is in progress? Careful: the same goes for the parent when handling IMG_REGISTER operations.
(4) Request Queue and STDOUT Console: We already know that the shared request queue and the
shared STDOUT console require the use of semaphores to ensure correctness. Perhaps take inspiration from
the use of semaphores in those cases to handle the other shared data structures listed above.
Desired Output. The expected server output is pretty much what you already constructed in HW6. Here
is it summarized again for reference. You should print queue status dumps, rejection and completion notices.
Queue status dumps and rejection notice are identical in format to HW5 and HW6. Once again, the queue
dump status is printed when any of the worker threads completes processing of any of the requests.
Just like HW6, when a request successfully completes service, the thread ID of the worker thread that has
completed the request will need to be added at the beginning of the line following the format below. You can
assign thread ID = (number of workers + 1) to the parent thread. If multiple worker threads are available to
process a pending request, any one of them (but only at most one!) can begin processing the next request.
T<thread ID> R<req. ID>:<sent ts>,<img_op>,<overwrite>,<client img_id>,<server img_id>,<receipt ts>,
<start ts>,<compl. ts>
Here, <img_op> is a string representing the requested operation over an image. For instance, if the operation
was IMG_REGISTER, then the server should output the string “IMG REGISTER” (no quotes) for this ffeld.
<overwrite> should just be 0 or 1, depending on what the client requested. <client img_id> should be
the image ID for which the client has requested an operation. If the server is ignoring any of these values
in the response, set these ffelds to 0. Finally, <server img_id> should report the image ID on which the
server has performed the operation requested by the client. Recall that this might be different from what
sent by the client if overwrite = 0 in the client’s request, but it must be the same if overwrite = 1.
Additional Help. You might have noticed, from the commands recommended above, that the client (v4.2)
now allows you to deffne a script of image operation requests. This is useful to test the correctness of your
server under a controlled workload.
To use this feature, you should still provide the path to the folder containing the test images using the
-I <path to images folder> parameter. Next, you should also provide the -L <images request script>
parameter, where the <images request script> is a comma-separated list of image operations with the
following format:
Problem 1 continued on next page. . . 3CS-350 - Fundamentals of Computing Systems::Homework Assignment #8 - BUILD Problem 1 (continued)
<time to next operation>:<opcode char>:<overwrite>:<image ID>.
Here, <time to next operation> is a number of seconds that will elapse between this and the next operation
 in the script.
Next, <opcode char> is a single case-sensitive (!!) letter that identiffes which operation to be performed
(see list below).
• R: IMG_REGISTER
• r: IMG_ROT**CLKW
• b: IMG_BLUR
• s: IMG_SHARPEN
• v: IMG_VERTEDGES
• h: IMG_HORIZEDGES
• T: IMG_RETRIEVE
The <overwrite> ffeld should always be set to 1 (for simplicity we do not handle cases with overwrite = 0).
Finally, the <image ID> should be the ID on which the operation should be performed. This ffeld has a
special meaning in the case of IMG_REGISTER operations. Only in this case, it tells the client which one of
the ffles scanned in the images folder should be registered with the server. In all the other cases, an ID = n
tells the client to request the operation on the n
th
image that it has registered with the server.
When a script is requested at the client, the client will conveniently report how it has understood the script.
For instance, when using the script:
1:R:1:2,2:b:1:0,0:T:1:0
the client will report:
[#CLIENT#] INFO: Reading BMP 0: test1.bmp | HASH = 9f3363f0249c15163d52e60fd9544c31
[#CLIENT#] INFO: Reading BMP 1: test2.bmp | HASH = b6770726558da9722136ce84f12bfac8
[#CLIENT#] INFO: Reading BMP 2: test3.bmp | HASH = f2ac174**6fb2be614e8ab1ae10e82f0
[#CLIENT#] INFO: Reading BMP 3: test4.bmp | HASH = 0caaef67aee1775ffca8eda02bd85f25
[#CLIENT#] INFO: Reading BMP 4: test5.bmp | HASH = 5597b44eaee51bd81292d711c86a3380
[#CLIENT#] INFO: Reading BMP 5: test6.bmp | HASH = 11552ac97535bd4433891b63ed1dd45d
[#CLIENT#] Next Req.: +1.000000000 - OP = IMG_REGISTER, OW = 1, ID = 0
[#CLIENT#] Next Req.: +2.000000000 - OP = IMG_BLUR, OW = 1, ID = 0
[#CLIENT#] Next Req.: +0.000000000 - OP = IMG_RETRIEVE, OW = 1, ID = 0
4CS-350 - Fundamentals of Computing Systems::Homework Assignment #8 - BUILD Problem 2
Submission Instructions: in order to submit the code produced as part of the solution for this homework
assignment, please follow the instructions below.
You should submit your solution in the form of C source code. To submit your code, place all the .c
and .h ffles inside a compressed folder named hw8.zip. Make sure they compile and run correctly according
 to the provided instructions. The ffrst round of grading will be done by running your code.
Use CodeBuddy to submit the entire hw8.zip archive at https://cs-people.bu.edu/rmancuso/courses/
cs350-fa24/codebuddy.php?hw=hw8. You can submit your homework multiple times until the deadline.
Only your most recently updated version will be graded. You will be given instructions on Piazza on how
to interpret the feedback on the correctness of your code before the deadline.


請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:CSE2425代寫(xiě)、C++編程語(yǔ)言代做
  • 下一篇:代寫(xiě)XJEL1703、MATLAB設(shè)計(jì)編程代做
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁(yè)版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    无码aⅴ精品一区二区三区浪潮| 欧美激情国产日韩| 国产欧美日韩丝袜精品一区| 久操成人在线视频| 成人动漫在线观看视频| 成人久久一区二区三区| av色综合网| 欧美激情二区三区| 国产女人水真多18毛片18精品| 国产精品露脸自拍| 国内少妇毛片视频| 国产精品久久在线观看| 国产成人在线一区| 一道精品一区二区三区| 68精品久久久久久欧美| 秋霞成人午夜鲁丝一区二区三区| 久草综合在线观看| 国内精品**久久毛片app| 在线一区高清| 亚洲一区三区在线观看| 欧美日韩在线不卡视频| 国产精品免费一区二区三区| 欧美人与性禽动交精品| 国产精品视频午夜| 国产原创精品| 中文字幕在线乱| 午夜精品美女自拍福到在线| 久久久视频在线| 国内精品一区二区三区| 天天干天天色天天爽| 国产精品久久久久久久乖乖| 国产精品夜色7777狼人| 欧洲精品久久| 亚洲中文字幕无码专区| 国产成人无码精品久久久性色| 国产欧美日韩视频一区二区三区| 色大师av一区二区三区| 麻豆国产va免费精品高清在线| 久久久人人爽| 国产免费一区视频观看免费| 日韩免费视频在线观看| 欧美日韩xxxxx| 日韩在线播放一区| 成人精品在线视频| 欧美乱大交xxxxx潮喷l头像| 亚洲在线不卡| 久久久国产视频| 91好吊色国产欧美日韩在线| 蜜桃麻豆91| 亚洲第一页在线视频| 日韩中文字在线| 国产欧美精品一区二区三区-老狼| 亚洲资源在线看| 日韩中文第一页| 国产日韩在线免费| 午夜精品一区二区三区在线视频| 欧美激情xxxx| 久久av免费一区| 99在线免费视频观看| 欧美日韩一区二区视频在线 | 国产日产久久高清欧美一区| 日本一区二区三区在线播放| 久久久久久com| 国产精品久久久久久久午夜 | 亚洲综合中文字幕在线| 国产精品少妇在线视频| 91久久偷偷做嫩草影院| 国产一区视频观看| 欧美日韩国产综合在线| 少妇av一区二区三区无码 | 五月天婷亚洲天综合网鲁鲁鲁| 精品久久久久久无码中文野结衣| 久久久久久久久91| 久久亚裔精品欧美| 91久久精品国产91性色| 国产美女搞久久| 精品一区久久久| 欧美亚洲另类在线一区二区三区| 岛国视频一区| 亚洲v欧美v另类v综合v日韩v| 久久99精品久久久久久噜噜| 国产精品久久久一区| 久久精品aaaaaa毛片| 99爱精品视频| 成人国内精品久久久久一区| 国产欧美韩国高清| 国产一区二区自拍| 免费观看国产成人| 国内一区二区在线视频观看| 欧美日韩亚洲国产成人| 欧日韩免费视频| 欧洲日本亚洲国产区| 日韩精品久久一区| 日本福利视频导航| 日本精品在线视频| 日本a在线免费观看| 日本精品免费一区二区三区| 天天爽天天狠久久久| 亚洲精品日韩在线观看| 亚洲中文字幕无码专区| 亚洲精品女av网站| 视频一区二区三区免费观看| 日本一区视频在线播放| 欧美在线视频网| 欧美久久久久久一卡四| 欧美在线视频a| 欧美日韩一区二区视频在线| 激情成人开心网| 国产专区欧美专区| 国产欧美日韩91| 99在线观看| 国产高清精品软男同| 久久亚洲a v| 日韩一区av在线| 国产精品你懂得| 麻豆乱码国产一区二区三区| 欧美激情精品久久久久| 亚洲欧洲日韩精品| 日本免费久久高清视频| 欧美日韩精品一区| 国产在线视频欧美| 成人免费毛片播放| 久久精品久久精品国产大片| 久久国内精品一国内精品| 国产精品久久国产精品| 欧美激情xxxx| 性色av香蕉一区二区| 日产国产精品精品a∨| 欧洲成人在线观看| 国产美女99p| 国产成人精品久久二区二区| 国产精品视频一区二区三区经| 国产99午夜精品一区二区三区| 亚洲不卡中文字幕无码| 欧美日韩一区二区视频在线| 成人在线观看毛片| 久久国产精品99久久久久久丝袜| 国产精品丝袜久久久久久消防器材| 欧美理论电影在线观看| 三级网在线观看| 国模精品一区二区三区色天香| av免费观看国产| 久久99精品久久久久久青青日本 | 色天天综合狠狠色| 欧美激情亚洲精品| 日韩男女性生活视频| 国产一区二区三区精彩视频| 91高清视频免费| 国产精品免费一区二区三区都可以 | 国产va免费精品高清在线观看| 成人免费无码av| 99久久精品免费看国产四区| 国产精品99久久久久久久久久久久| 91免费精品视频| 久久大香伊蕉在人线观看热2| 日韩专区中文字幕| 国产精品久久一区二区三区| 欧美激情视频在线观看| 亚洲国产另类久久久精品极度| 日韩美女免费线视频| 韩国视频理论视频久久| 不卡一区二区三区视频| 91国产一区在线| 久久久www成人免费精品张筱雨 | 久久99久久99精品中文字幕| 亚洲欧美综合一区| 欧美中文娱乐网| 国产卡一卡二在线| 国产成人精品免高潮在线观看| 久久精品亚洲热| 中文字幕在线观看一区二区三区| 日韩亚洲在线视频| 国产欧美精品一区二区三区| 国产二区一区| 国产精品啪啪啪视频| 中文字幕日韩一区二区三区不卡| 日韩av电影在线网| 蜜臀av.com| 久久天堂国产精品| 欧美成人亚洲成人日韩成人| 欧美一区二区三区精美影视| 国产中文字幕免费观看| 国产激情在线看| 欧美成在线观看| 日本a在线免费观看| 国产精品夜色7777狼人| 日韩最新av在线| 亚洲一区影院| 国模一区二区三区私拍视频| av电影一区二区三区| 久久精品国产视频| 亚洲成人午夜在线| 国产免费黄色小视频| 国产成人精品在线播放| 亚洲一区二区在线观| 精品视频一区二区| 久艹在线免费观看| 亚洲wwwav| 爱福利视频一区二区| 欧美成人免费在线观看|