{"id":27129216,"url":"https://github.com/gotz1480/multithreaded-server-c","last_synced_at":"2025-04-07T19:22:27.790Z","repository":{"id":125834410,"uuid":"425670373","full_name":"gotz1480/multithreaded-server-c","owner":"gotz1480","description":"Multithreaded server implementation in C using websockets and POSIX threads","archived":false,"fork":false,"pushed_at":"2021-11-09T04:51:01.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T13:13:19.926Z","etag":null,"topics":["multi-threaded-server","multithreaded-server","multithreading","posix-threads","pthreads","pthreads-api","websockets","websockets-server"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gotz1480.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-11-08T02:13:32.000Z","updated_at":"2024-03-02T22:56:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"36e434a0-dedd-4d29-8452-e77f89f66fb4","html_url":"https://github.com/gotz1480/multithreaded-server-c","commit_stats":null,"previous_names":["gotz1480/multithreaded-server-c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotz1480%2Fmultithreaded-server-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotz1480%2Fmultithreaded-server-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotz1480%2Fmultithreaded-server-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotz1480%2Fmultithreaded-server-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gotz1480","download_url":"https://codeload.github.com/gotz1480/multithreaded-server-c/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713466,"owners_count":20983719,"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","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":["multi-threaded-server","multithreaded-server","multithreading","posix-threads","pthreads","pthreads-api","websockets","websockets-server"],"created_at":"2025-04-07T19:22:26.680Z","updated_at":"2025-04-07T19:22:27.764Z","avatar_url":"https://github.com/gotz1480.png","language":"C","readme":"# multithreaded-server-c\n\n## Description\n\nMultithreaded server implementation in C using websockets and POSIX threads. A single-threaded server perfomance is compared with a multi-threaded server perfomance using the `time` tool.\n\n## Installation\n\nRun `make all` inside the folders \"multithread\" and \"single-thread\".\n\n## Comparing perfomance\n\nThe bash script `manyclients.bash` will run, at the same time, 50 requests from the client to the server (check `client.c` for details).\n\n### Single-threaded server\n\nIn \"single-thread\" folder, run `./server`. This will make the single-threaded server start listening (port 9002). Then, at another terminal, run `time ./manyclients.bash`. This will run 50 concurrent requests to the server. At the end of the script, the following results should appear, which should differ depending on your machine perfomance:\n\n```\nreal  0m2.262s\nuser  0m0.004s\nsys   0m0.004s\n```\n\n### Multi-threaded server\n\nFor the multi-threaded server, go to the folder \"multithread\" and run `./server` to start the server. This will make the multi-threaded server start listening (port 9002). Then, at another terminal, run `time ./manyclients.bash`. This will run 50 concurrent requests to the server. At the end of the script, the following results should appear, which should differ depending on your machine perfomance:\n\n```\nreal\t0m0.018s\nuser    0m0.000s\nsys     0m0.008s\n```\n\nAs seen from the results, the multi-threaded server was around 125 times faster than the single-threaded server.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotz1480%2Fmultithreaded-server-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgotz1480%2Fmultithreaded-server-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotz1480%2Fmultithreaded-server-c/lists"}