{"id":17802958,"url":"https://github.com/arodr967/multithreading_fun","last_synced_at":"2025-08-14T05:12:46.065Z","repository":{"id":93348862,"uuid":"95937138","full_name":"arodr967/multithreading_fun","owner":"arodr967","description":"Multithreading in C.","archived":false,"fork":false,"pushed_at":"2017-07-10T03:46:48.000Z","size":871,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T04:47:59.662Z","etag":null,"topics":["c-programming","matrix-multiplication","multithreading","parallel-programming","scheduling","scheduling-algorithms","synchronization"],"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/arodr967.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}},"created_at":"2017-07-01T02:29:24.000Z","updated_at":"2022-10-04T15:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1ac9fac-3951-45dd-b042-6e967da46b7c","html_url":"https://github.com/arodr967/multithreading_fun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arodr967/multithreading_fun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodr967%2Fmultithreading_fun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodr967%2Fmultithreading_fun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodr967%2Fmultithreading_fun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodr967%2Fmultithreading_fun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arodr967","download_url":"https://codeload.github.com/arodr967/multithreading_fun/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodr967%2Fmultithreading_fun/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268866778,"owners_count":24320281,"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-08-05T02:00:12.334Z","response_time":2576,"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":["c-programming","matrix-multiplication","multithreading","parallel-programming","scheduling","scheduling-algorithms","synchronization"],"created_at":"2024-10-27T12:45:04.025Z","updated_at":"2025-08-05T09:07:47.372Z","avatar_url":"https://github.com/arodr967.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multithreaded Programming and Synchronization\n\n- [Part 1: Simple Multi-threaded Programming using Pthreads](#part-1-simple-multi-threaded-programming-using-pthreads)\n- [Part 2: Multi-threaded/Parallel Programming using OpenMP](#part-2-multi-threadedparallel-programming-using-openmp)\n- [Part 3: OpenMP Solution for Queue Scheduling Problem in Task 1.3](#part-3-openmp-solution-for-queue-scheduling-problem-in-task-13)\n\n\n## Part 1: Simple Multi-threaded Programming using Pthreads\n\nFiles found for part 1 are in the `part_1/` directory.\n\n### Tasks 1 \u0026 2\n\nTasks 1 and 2 can be found in `task1_2.c`.\n\n#### Compile \u0026 Run _without_ Synchronization\n\n1. `gcc -pthread task1_2.c -o task1_2`\n2. `./task1_2 \u003cnumber_of_threads\u003e`\n\nPlace output into a file by:\n\n`./task1_2 \u003cnumber_of_threads\u003e \u003e task1_1_results/\u003cnumber_of_threads\u003e_threads_results.txt`\n\n\u003e Example: `./task1_2 200 \u003e task1_1_results/200_threads_results.txt`\n\n_Some output files have already been added from previous executions._\n\n#### Compile \u0026 Run _with_ Synchronization\n\n1. `gcc -pthread -Wall -D PTHREAD_SYNC task1_2.c -o task1_2_sync`\n2. `./task1_2_sync \u003cnumber_of_threads\u003e`\n\n\u003e NOTE: Some warnings might appear but they will not prevent the program from executing.\n\nPlace output into a file by:\n\n`./task1_2_sync \u003cnumber_of_threads\u003e \u003e task1_2_results/\u003cnumber_of_threads\u003e_threads_results.txt`\n\n\u003e Example: `./task1_2_sync 200 \u003e task1_2_results/200_threads_results.txt`\n\n_Some output files have already been added from previous executions._\n\n### Task 3\n\nTask 3 can be found in `task1_3.c`\n\n#### Compile \u0026 Run\n\n1. `gcc -pthread -lm task1_3.c -o task1_3`\n2. `./task1_3 \u003cnumber_of_students\u003e \u003coffice_capacity\u003e`\n\n\n\n## Part 2: Multi-threaded/Parallel Programming using OpenMP\n\nFiles found for part 2 are in the `part_2/` directory.\n\n### Tasks 1, 2, and 3\n\n- Task 1 can be found in `OpenMP/helloworld.c`\n- Task 2 can be found in `task2_2.c`\n- Task 3 can be found in `task2_3.c`\n\n#### Compile \u0026 Run\n\nAny of the files above an be compiled and run the following way:\n\n1. `gcc -fopenmp task2_2.c -o task2_2`\n2. `./task2_2`\n\n### Task 4\n\nTask 4 can be found separated as 4 different files.\n\n- `task2_4_original.c` is the original code that is given on the assignment.\n- `task2_4_outer.c` is the parallelized code with only the outer for loop parallelized.\n- `task2_4_middle.c` is the parallelized code with only the middle for loop parallelized.\n- `task2_4_both.c` is the parallelized code with both the outer and middle loops parallelized.\n\n#### Compile \u0026 Run\n\nAny of the files above an be compiled and run the following way:\n\n1. `gcc -fopenmp task2_4_original.c -o task2_4_original`\n2. `./task2_4_original`\n\n\n\n## Part 3: OpenMP Solution for Queue Scheduling Problem in Task 1.3\n\nFile found for part 3 are in `part_3/task1_3_OpenMP.c`\n\n#### Compile \u0026 Run\n\n1. `gcc -fopenmp -lm task1_3_OpenMP.c -o task1_3_OpenMP`\n2. `./task1_3_OpenMP \u003cnumber_of_students\u003e \u003coffice_capacity\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farodr967%2Fmultithreading_fun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farodr967%2Fmultithreading_fun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farodr967%2Fmultithreading_fun/lists"}