{"id":22753044,"url":"https://github.com/jacintogomez/concurrency-control","last_synced_at":"2025-10-06T01:53:23.325Z","repository":{"id":211938398,"uuid":"730285525","full_name":"jacintogomez/Concurrency-Control","owner":"jacintogomez","description":"Using locks to prevent race conditions in operating systems","archived":false,"fork":false,"pushed_at":"2023-12-11T17:08:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T07:17:36.267Z","etag":null,"topics":["concurrency-control","mutex","operating-systems","semaphores","spinlock"],"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/jacintogomez.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}},"created_at":"2023-12-11T15:41:56.000Z","updated_at":"2024-04-20T03:17:02.000Z","dependencies_parsed_at":"2023-12-11T18:26:53.638Z","dependency_job_id":"60033152-026a-491c-b669-36189e5d8ad5","html_url":"https://github.com/jacintogomez/Concurrency-Control","commit_stats":null,"previous_names":["jacintogomez/concurrency-control"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jacintogomez/Concurrency-Control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacintogomez%2FConcurrency-Control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacintogomez%2FConcurrency-Control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacintogomez%2FConcurrency-Control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacintogomez%2FConcurrency-Control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacintogomez","download_url":"https://codeload.github.com/jacintogomez/Concurrency-Control/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacintogomez%2FConcurrency-Control/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547817,"owners_count":26004773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["concurrency-control","mutex","operating-systems","semaphores","spinlock"],"created_at":"2024-12-11T06:08:44.049Z","updated_at":"2025-10-06T01:53:23.279Z","avatar_url":"https://github.com/jacintogomez.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Concurrency-Control\n\n`concurrency.cpp` shows how an unsynchronized threaded program  will print when no locks are placed around the print statements. The \"proper\" output of this code is below:\n\n\u003cimg width=\"300\" alt=\"Screenshot 2023-12-11 at 12 06 27 PM\" src=\"https://github.com/jacintogomez/Concurrency-Control/assets/63368475/55bb6edc-5333-47eb-8911-674d193de5a1\"\u003e\n\n\nBut that will not be printed as the threads will compete for the value of the num variable and access to the console. Realistically you'll see something more like \nthis when running `concurrency.cpp`:\n\n\u003cimg width=\"300\" alt=\"Screenshot 2023-12-11 at 12 05 50 PM\" src=\"https://github.com/jacintogomez/Concurrency-Control/assets/63368475/a5513850-761a-4028-ba56-de71382c6cf1\"\u003e\n\nThe provided files `spinlock.cpp`, `mutex.cpp`, and `semaphore.cpp` show how the correct printing can be achieved by placing a lock around the `printmanylines()` function. \nThis ensures that the blocks of numbers finish printing before allowing another thread to print its num.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacintogomez%2Fconcurrency-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacintogomez%2Fconcurrency-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacintogomez%2Fconcurrency-control/lists"}