{"id":20649287,"url":"https://github.com/repalash/pthreads-semaphores-analysis","last_synced_at":"2026-04-21T19:32:47.151Z","repository":{"id":84265139,"uuid":"47763779","full_name":"repalash/Pthreads-Semaphores-analysis","owner":"repalash","description":"The aim of this project is to analyze the role of concurrency and synchronization on program performance.","archived":false,"fork":false,"pushed_at":"2015-12-10T13:38:14.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T07:58:26.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/repalash.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}},"created_at":"2015-12-10T13:32:16.000Z","updated_at":"2015-12-10T13:38:15.000Z","dependencies_parsed_at":"2023-03-14T20:00:36.161Z","dependency_job_id":null,"html_url":"https://github.com/repalash/Pthreads-Semaphores-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/repalash/Pthreads-Semaphores-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repalash%2FPthreads-Semaphores-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repalash%2FPthreads-Semaphores-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repalash%2FPthreads-Semaphores-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repalash%2FPthreads-Semaphores-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/repalash","download_url":"https://codeload.github.com/repalash/Pthreads-Semaphores-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repalash%2FPthreads-Semaphores-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32106645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"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":[],"created_at":"2024-11-16T17:13:43.007Z","updated_at":"2026-04-21T19:32:47.131Z","avatar_url":"https://github.com/repalash.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pthreads-Semaphores-analysis\r\nThe aim of this project is to analyze the role of concurrency and synchronization on program performance.\r\nDone as an OS Course assignment.\r\n\r\n## Problem Statement\r\n1. Write a simple counter -non-thread safe. Name the file as Rollno_counter1_nonsafe.c\r\n2. Write a simple thread-safe counter. Name the file as Rollno_counter2_safe.c\r\n3. Write a single thread program that uses the counter1 and counts till one billion and measure the time taken. Name the file as Rollno_stp.c\r\nDo this 50 times (write a program to do it) and compute the average time taken to count one billion with a single thread program.\r\n4. Write a multi-thread program that uses  first the counter1 and then counter2 and counts till one billion. Name the files as Rollno_mtp_c1.c for counter1 and Rollno_mtp_c2.c for counter2.\r\nIncrease the number of threads starting from 2 to 10 counting 50 times each (write a program to do it) and compute the average time taken. \r\nMeasure the average time. \r\nPlot all the averages that you obtained including the one which you computed earlier and explain it in terms of performance and correctness specifically: 1) do you see any relation between number of threads and performance, what is it 2) do you see any relation between number of threads and correctness, what is it - submit the plot and your explanation as a pdf file and name it as Rollno_plot1.pdf.\r\n5. Write a multi-threaded program that uses counter 1, with semaphores to ensure correctness,  to count till billions.  Increase the number of threads starting from 2 to 10 counting 50 times each (write a program to do it) and compute the average time taken. \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepalash%2Fpthreads-semaphores-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepalash%2Fpthreads-semaphores-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepalash%2Fpthreads-semaphores-analysis/lists"}