{"id":21684173,"url":"https://github.com/mirsahib/project-jupiter","last_synced_at":"2026-05-15T18:32:53.173Z","repository":{"id":70342419,"uuid":"159643040","full_name":"mirsahib/Project-Jupiter","owner":"mirsahib","description":"IUB CSE 413 (Operating System)","archived":false,"fork":false,"pushed_at":"2018-12-09T06:21:01.000Z","size":436,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-08T08:47:40.360Z","etag":null,"topics":["c","linux","operating-system"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirsahib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-29T09:44:25.000Z","updated_at":"2018-12-09T06:21:02.000Z","dependencies_parsed_at":"2023-02-23T20:30:45.701Z","dependency_job_id":null,"html_url":"https://github.com/mirsahib/Project-Jupiter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mirsahib/Project-Jupiter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsahib%2FProject-Jupiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsahib%2FProject-Jupiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsahib%2FProject-Jupiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsahib%2FProject-Jupiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirsahib","download_url":"https://codeload.github.com/mirsahib/Project-Jupiter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsahib%2FProject-Jupiter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","linux","operating-system"],"created_at":"2024-11-25T16:14:49.858Z","updated_at":"2026-05-15T18:32:53.156Z","avatar_url":"https://github.com/mirsahib.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Assignment\n\n**A**. Write a program in which producer process creates a child process, child process takes\ninput to generate two matrices and put in the shared memory and parent process reads the\nmatrices in the shared memory and then calculates the product matrix using multiple\nthreads and stores in the shared memory, a separate client process reads product matrix and\nprints on the console.\n\n**B**. Write a program that creates three child processes and three pipes to communicate with each\nprocess. Each child process reads from different serial line and sends the characters read back\nto the parent process through a pipe. The parent process outputs all characters received on the\nconsole. A child terminates when two newline characters are received consecutively. The\nparent terminates after all three children have terminated. (hint: send-pipe and receive-pipe\nprimitives can be used)\n\n**C**. The reader writer problem: A number of readers may simultaneously be reading from a file.\nOnly one writer at a time may write to file, and no reader can be reading while a writer is\nwriting. Using semaphores, Write solution to the reader writers problem that gives priority\nto writers.\n\n**D**. Modify the socket-based date server (Figure 3.21) in Chapter 3 so that the server\nservices each client request in a separate thread.\n\n**E. Banker’s Algorithm**\nFor this project, you will write a multithreaded program that implements the banker’s algorithm\ndiscussed in Section 7.5.3. Several customers request and release resources from the bank. The\nbanker will grant a request only if it leaves the system in a safe state. A request that leaves the\nsystem in an unsafe state will be denied. This programming assignment combines three\nseparate topics:\n(1) multithreading, (2) preventing race conditions, and (3) deadlock avoidance.\n\u003cbr\u003e**The Banker**\nThe banker will consider requests from n customers for m resources types. As outlined in\nSection 7.5.3. The banker will keep track of the resources using the following data structures:\n/* these may be any values \u003e= 0 */\n #define NUMBER OF CUSTOMERS 5\n #define NUMBER OF RESOURCES 3\n/* the available amount of each resource */\nint available[NUMBER OF RESOURCES];\n/*the maximum demand of each customer */\nint maximum[NUMBER OF CUSTOMERS][NUMBER OF RESOURCES];\n/* the amount currently allocated to each customer */\nint allocation[NUMBER OF CUSTOMERS][NUMBER OF RESOURCES];/* the remaining need of each customer */\nint need[NUMBER OF CUSTOMERS][NUMBER OF RESOURCES];\n\u003cbr\u003e**The Customers**\nCreate n customer threads that request and release resources from the bank. The customers will\ncontinually loop, requesting and then releasing random numbers of resources. The customers’\nrequests for resources will be bounded by their respective values in the need array. The banker\nwill grant a request if it satisfies the safety algorithm discussed in the class. If a request does\nnot leave the system in a safe state, the banker will deny it. Function prototypes for requesting\nand releasing resources are as follows:\nint request resources(int customer num, int request[]);\nint release resources(int customer num, int release[]);\nThese two functions should return 0 if successful (the request has been granted) and –1 if\nunsuccessful. Multiple threads (customers) will concurrently access shared data through these\ntwo functions. Therefore, access must be controlled through mutex locks to prevent race\nconditions.\n\u003cbr\u003e**Implementation**\nYou should invoke your program by passing the number of resources of each type on the\ncommand line. For example, if there were three resource types, with ten instances of the first\ntype, five of the second type, and seven of the third type, you would invoke your program\nfollows:\n./a.out 10 5 7\nThe available array would be initialized to these values. You may initialize the\nmaximum array (which holds the maximum demand of each customer) using any\nmethod you find convenient .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirsahib%2Fproject-jupiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirsahib%2Fproject-jupiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirsahib%2Fproject-jupiter/lists"}