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

        代做UVic CSC360 程序語(yǔ)言

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


        # Assignment 2

         

        ## UVic CSC360 Spring 2024

         

        **Due Monday March 4, at 11:55 pm** via `push` to your `gitlab.csc`

         repository.

         

        ## Programming Platform

         

        For this assignment your code must work in the Jupyterlab environment

        provisioned for you at `https://jhub-cosi.uvic.ca/`.  You may already

        have access to your own Unix system (e.g., Ubuntu, Debian, Cygwin on

        Windows 11, macOS with MacPorts, etc.) yet we recommend you work as

        much as possible with your CSC360 JupyterLab environment. Bugs in

        systems programming tend to be platform-specific and something that

        works perfectly at home may end up crashing on a different

        computer-language library configuration. (We cannot give marks for

        submissions of which it is said “It worked on Visual Studio!”)

         

        ## Individual work

         

        This assignment is to be completed by each individual student (i.e.,

        no group work).  Naturally you will want to discuss aspects of the

        problem with fellow students, and such discussions are encouraged.

        However, **sharing of code is strictly forbidden**. If you are still

        unsure about what is permitted or have other questions regarding

        academic integrity, please direct them as soon as possible to the

        instructor. (Code-similarity tools will be run on submitted programs.)

        Any fragments of code found on the web and used in your solution must

        be properly cited where it is used (i.e., citation in the form of a

        comment given source of code).

         

        ## Use of `gitlab.csc.uvic.ca`

         

        Each student enrolled in the course has been assigned a Git repository

        at `gitlab.csc.uvic.ca`. For example, the student having Netlink ID

        `johnwick` would have their CSC 360 repository at this location:



        ```

         

        Please form the address of your repository appropriately **and if you

        have not already done so**  perform a `git clone` in your jupyterlab

        environment. You are also able to access this repository by going to

        `https://gitlab.csc.uvic.ca` (and use your Netlink username and

        password to log in at that page). **If you have already used `clone` to

        obtain your repository** the use `git pull` to retrieve files for this

        assignment.

         

        ---

         

        ## Goals of this assignment

         

        This is an opportunity for you to use -- and perhaps wrestle with --

        concurrency in an imperative programming language such as C. Some of

        the ideas you may use here for solving the problems of cooperating

        and competing threads/tasks can be used in other languages such as Java.

         

        1. Write a program (`kosmos-sem.c`) that solves the **Kosmos-methoxy-radical**

        problem with the use of semaphores.

         

        2. Write a program (`kosmos-mcv.c`) that solves the **Kosmos-methoxy-radical**

        problem with the use of mutexes and condition variables.

         

        ---

         

        ## The **Kosmos-methoxy radical** problem

         

        You are hired by an interstellar civilization of much greater intelligence that

        ours (!!) who are seeding the universe with the building blocks needed for a

        one of their major projects. The specific task you have agreed to help solve

        for them is to manage the chemical reaction needed to form **methoxy radicals**

        (which is made up of one carbon atom, one oxygen atom, and three hydrogen atoms).

         

        Despite the civilization's greater intelligence, they are having trouble getting

        the carbon, oxygen, and hydrogen atoms to combine correctly due to some serious synchronization

        problems. They are able to create each atom (i.e., one atom equals one thread), and so

        the challenge is to get one carbon thread, three hydrogen threads, and one oxygen thread all together at the

        same time, regardless of the number or order of thread/atom creation.

         

        Each carbon atom invokes a function named `c_ready()`when it is ready to react;

        each hydrogen atom invokes a function named `h_ready()`when it is ready to react; and finally each oxygen atom invokes a function named `o_ready()` when it is ready to react.

        For this problem you are to complete the code for `c_ready`, `h_ready`, and `o_ready`, adding

        whatever code and data structures are needed to solve the problem.

         

        Here are some other requirements for solutions:

         

        * Skeleton files that will help you get started on the goal are available in

          this repository.

         

        * The `h_ready`, `c_ready`, and `o_ready` functions must only delay until there are at least

          one carbon, one oxygen, and three hydrogen atoms ready to combine into the radical.

         

        * **You are not permitted** to wait until all threads / atoms are

        created such that you then match up atoms once you know what exists.

        This means your solution must work when the next atom/thread created

        is a hydrogen atom when there exist already one carbon, one oxgygen,

        and two hydrogens; or when the next atom/thread created is a carbon

        atom when there exist already one oxygen and three hydrogen; and so

        forth and so on.

         

        * When an arriving atom/thread determines that a radical can be made,

        then that atom/thread must cause the radical to be made to indicate

        the identities of the carbon atom, oxygen atom, and hydrogen atoms.

        Below is an example showing the format of the report, where each line

        indicates the atoms in a radical, and the atom/thread in parentheses

        was the one that initiated the creation of the radical. For example,

        below the 7th radical consists of carbon atom 7, oxygen atom 7,

        hydrogen atoms 21 & 22 & 23, and it was the carbon atom that triggered

        the creation of the radical

        掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
      1. 上一篇:代寫(xiě)ENG3018、MATLAB設(shè)計(jì)編程代做
      2. 下一篇:莆田鞋在哪里買(mǎi)-推薦10個(gè)最新渠道
      3. 無(wú)相關(guān)信息
        合肥生活資訊

        合肥圖文信息
        急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
        急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
        出評(píng) 開(kāi)團(tuán)工具
        出評(píng) 開(kāi)團(tuán)工具
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士2號(hào)線
        合肥機(jī)場(chǎng)巴士2號(hào)線
        合肥機(jī)場(chǎng)巴士1號(hào)線
        合肥機(jī)場(chǎng)巴士1號(hào)線
      4. 短信驗(yàn)證碼 酒店vi設(shè)計(jì) deepseek 幣安下載 AI生圖 AI寫(xiě)作 aippt AI生成PPT

        關(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日韩综合一区| 三上悠亚精品一区二区久久| 免费无码毛片一区二区APP| 国产在线aaa片一区二区99| 日韩精品一区二三区中文| 波多野结衣一区二区三区aV高清| 国产精品99无码一区二区| 日韩精品一区二区三区在线观看| 久久精品无码一区二区三区日韩 | 日韩精品无码Av一区二区| 亚洲第一区精品观看| 久久国产精品视频一区| 中文字幕AV无码一区二区三区| 国产成人av一区二区三区在线 | 自慰无码一区二区三区| 日韩人妻不卡一区二区三区 | 久久AAAA片一区二区| 亚洲av鲁丝一区二区三区| 男人的天堂av亚洲一区2区| 亚洲一区精品伊人久久伊人| 少妇无码一区二区三区| 日韩精品一区二区三区中文版| 久久久久人妻一区精品果冻| 欧洲无码一区二区三区在线观看| 国模吧一区二区三区精品视频| av无码一区二区三区| 亚洲一区精彩视频| 国产成人片视频一区二区| 精品福利一区二区三区免费视频| 风流老熟女一区二区三区| 国产在线乱子伦一区二区| 精品人体无码一区二区三区| 亚洲一区二区三区高清在线观看| 国产福利电影一区二区三区,免费久久久久久久精 | 一区二区免费视频| 精品亚洲福利一区二区| 亚洲AV美女一区二区三区| 福利一区二区三区视频午夜观看| 亚洲成在人天堂一区二区| 日亚毛片免费乱码不卡一区| 日韩中文字幕精品免费一区|