{"id":15678597,"url":"https://github.com/gervinfung/simpleparalleldispatcher","last_synced_at":"2025-03-30T07:13:35.780Z","repository":{"id":115227220,"uuid":"309966079","full_name":"GervinFung/SimpleParallelDispatcher","owner":"GervinFung","description":"Simple Basic Parallel Program. A Java program that use thread and semaphore to simulate Dispatcher and Sorter","archived":false,"fork":false,"pushed_at":"2021-11-07T09:39:30.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T09:17:26.140Z","etag":null,"topics":["multithreaded","multithreading"],"latest_commit_sha":null,"homepage":"","language":"Java","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/GervinFung.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":"2020-11-04T10:13:53.000Z","updated_at":"2024-09-08T10:33:37.000Z","dependencies_parsed_at":"2023-05-25T22:32:03.305Z","dependency_job_id":null,"html_url":"https://github.com/GervinFung/SimpleParallelDispatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GervinFung%2FSimpleParallelDispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GervinFung%2FSimpleParallelDispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GervinFung%2FSimpleParallelDispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GervinFung%2FSimpleParallelDispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GervinFung","download_url":"https://codeload.github.com/GervinFung/SimpleParallelDispatcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285816,"owners_count":20752956,"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":["multithreaded","multithreading"],"created_at":"2024-10-03T16:22:52.629Z","updated_at":"2025-03-30T07:13:35.754Z","avatar_url":"https://github.com/GervinFung.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Write a multithreaded program to simulate the operations of Sorter, Dispatcher A and Dispatcher B in the scenario based on the following guidelines:\n\n1. Sorter, Dispatcher A and Dispatcher B are handled by a separate thread.\n2. An additional thread is used to simulate the arrival of item. This thread will generate an item\nrandomly (item A or B) at a random interval. (Use an appropriate interval range based on your\nsystem so that the program will not execute too fast, and you cannot monitor the output)\n3. Each storage bag can store 10 items and there is unlimited supply of storage bag.\nSorter will wait for the arrival of item and then put it in to the storage bag accordingly. Item\nwill arrive at a random interval.\n4. Dispatcher will wait until the bag is full before it moves it to the conveyor. It will then wait for\nthe next bag to be loaded.\n5. Each thread should print a message to indicate its current operation. Examples:\no Sorter may print messages such as\n\n| Process |\n| :--- |\n|1. Sorter: To bag B|\n|2. Sorter: waiting item...|\n|3. Sorter: To bag A (9)|\n|4. Sorter: waiting item...|\n|5. Sorter: To bag A (10)|\n|6. Sorter: Bag A full|\n|7. Sorter: waiting item...|\n\n|Thread that simulates arrival of item may print messages such as|\n| :--- |\n|1. Arrival: Item A|\n|2. Arrival: Item A|\n|3. Arrival: Item B|\n\nNote: the output from each thread may interleave.\n\n1. All threads should run iteratively.\n2. The program should be properly commented and meaningful name should be used for any\nvariable, function or method.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgervinfung%2Fsimpleparalleldispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgervinfung%2Fsimpleparalleldispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgervinfung%2Fsimpleparalleldispatcher/lists"}