{"id":23134429,"url":"https://github.com/wangwilly/osu-cse-6431","last_synced_at":"2026-04-30T10:32:03.064Z","repository":{"id":255505017,"uuid":"852296960","full_name":"WangWilly/osu-cse-6431","owner":"WangWilly","description":"Labs for operating systems","archived":false,"fork":false,"pushed_at":"2024-10-26T20:02:45.000Z","size":199,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T19:24:32.735Z","etag":null,"topics":["database","java","monitor","multithreading","mutual-exclusion","semaphore","transaction"],"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/WangWilly.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":"2024-09-04T15:10:02.000Z","updated_at":"2024-11-24T23:58:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"b525b3c2-50e7-4174-ac65-bfa97a5f9888","html_url":"https://github.com/WangWilly/osu-cse-6431","commit_stats":null,"previous_names":["wangwilly/osu-cse-6431"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWilly%2Fosu-cse-6431","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWilly%2Fosu-cse-6431/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWilly%2Fosu-cse-6431/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWilly%2Fosu-cse-6431/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WangWilly","download_url":"https://codeload.github.com/WangWilly/osu-cse-6431/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142423,"owners_count":20890725,"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":["database","java","monitor","multithreading","mutual-exclusion","semaphore","transaction"],"created_at":"2024-12-17T12:10:39.302Z","updated_at":"2026-04-30T10:31:58.034Z","avatar_url":"https://github.com/WangWilly.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OSU - CSE6431\n\nOperating System\n\n📌 Java environment:\n```bash\njava -version\n\n# (on MacOS)\n# java version \"21.0.4\" 2024-07-16 LTS\n# Java(TM) SE Runtime Environment (build 21.0.4+8-LTS-274)\n# Java HotSpot(TM) 64-Bit Server VM (build 21.0.4+8-LTS-274, mixed mode, sharing)\n\n# (on OSU coelinux)\n# openjdk version \"20.0.2\" 2023-07-18\n# OpenJDK Runtime Environment (build 20.0.2+9-78)\n# OpenJDK 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)\n```\n\n\n- [Homework 1](./hw1/hw1.pdf)\n    - [myAnswer](./hw1/myAnswer.md)\n    - Reference1: https://medium.com/@reetesh043/java-wait-notify-and-notifyall-methods-3d3b511bd3ae\n    - Reference2: https://stackoverflow.com/questions/5887709/getting-random-numbers-in-java\n    - Reference3: https://wangwilly.github.io/willywangkaa/2018/07/10/Operating-System-Process-Synchronization/\n    - Reference4: https://wangwilly.github.io/willywangkaa/2018/08/04/Operating-System-Process-Synchronization-2/\n    - Reference5: https://www.geeksforgeeks.org/static-variables-in-java-with-examples/\n\n- Lab 1\n    - Execute: `./scripts/runLab1.sh Database`\n    - Debug: `DEBUG=true ./scripts/debugLab1.sh Database`\n\n\n## Lab1\n\n### Apply test cases\n\n```bash\n./scripts/runLab1.sh Database1 ./testcases/lab1/db1_test1.txt\n\n./scripts/runLab1.sh Database2 ./testcases/lab1/db2_test1.txt\n```\n\nTest case format:\n\n```text\nRead\n\u003cTxId\u003e R \u003cRowId\u003e\n\nWrite\n\u003cTxId\u003e W \u003cRowId\u003e \u003cValue\u003e\n```\n\n### Deadlock Prevention\n\nPrompt: Since all rows are known before executing a transaction, you should be able to avoid the deadlock problem.\n\n- ❌ Deadlock Detection: Regularly check for cycles in the resource allocation graph and abort transactions to break deadlocks.\n- 🚧 Deadlock Prevention: Ensure that the system will never enter a deadlock state.\n    - **Hold and Wait**: Require processes to request all resources at once and prevent them from requesting additional resources while holding resources.\n    - (For 2-phase locking) Lock all resources before starting the transaction by ordering the resources and requesting them in order.\n\n### TODO\n\n- [x] Implement the history of operations in the database.\n- [x] Compute the serialization graph of the transactions from the history.\n- [x] Enumerate all possible serial schedules.\n- [x] Use flow algorithms to find a serial schedule from the serialization graph.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwilly%2Fosu-cse-6431","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangwilly%2Fosu-cse-6431","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwilly%2Fosu-cse-6431/lists"}