{"id":21887318,"url":"https://github.com/sskender/unix-posix","last_synced_at":"2025-07-12T14:42:16.059Z","repository":{"id":79364880,"uuid":"155699209","full_name":"sskender/UNIX-POSIX","owner":"sskender","description":"C programs that rely on POSIX standards","archived":false,"fork":false,"pushed_at":"2020-05-13T09:09:40.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T08:37:35.352Z","etag":null,"topics":["dekker","lamport","multiprocessing","multithreading","mutex","posix","semapho","shm","signal","sync","thread"],"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/sskender.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":"2018-11-01T10:34:26.000Z","updated_at":"2020-05-13T09:09:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d6ae7b2-39ac-49b6-8962-9920e83bc0ef","html_url":"https://github.com/sskender/UNIX-POSIX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sskender/UNIX-POSIX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sskender%2FUNIX-POSIX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sskender%2FUNIX-POSIX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sskender%2FUNIX-POSIX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sskender%2FUNIX-POSIX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sskender","download_url":"https://codeload.github.com/sskender/UNIX-POSIX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sskender%2FUNIX-POSIX/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265005003,"owners_count":23696528,"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":["dekker","lamport","multiprocessing","multithreading","mutex","posix","semapho","shm","signal","sync","thread"],"created_at":"2024-11-28T11:09:18.612Z","updated_at":"2025-07-12T14:42:16.016Z","avatar_url":"https://github.com/sskender.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UNIX-POSIX\nC programs that rely on POSIX standards\n\n- - - - \n\n## Signals and interrupts\n\n* Signals are a limited form of inter-process communication (IPC)\n\n* Used in Unix, Unix-like, and other POSIX-compliant operating systems\n\n* Signal is an asynchronous notification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred\n\n* When a signal is sent, the operating system interrupts the target process' normal flow of execution to deliver the signal\n    * If the process has previously registered a signal handler, that routine is executed\n    * Otherwise, the default signal handler is executed\n\n```c\n#include \u003csignal.h\u003e\n\nint sighold(int sig);\nint sigignore(int sig);\nint sigpause(int sig);\nint sigrelse(int sig);\nvoid (*sigset(int sig, void (*disp)(int)))(int);\n```\n\n### Examples\n\n1. [Prime numbers](interrupts/primes.c)\n    * SIGALRM, SIGINT\n    * Pause program and periodically print status\n\n2. [Signal handler](interrupts/handler.c)\n    * SIGUSR1, SIGUSR2\n    * Handle and keep track of multiple signals with different priority\n\n3. [Signal generator](interrupts/generator.c)\n    * Generate signals for handler\n\n- - - - \n\n## Multiprocessing and multithreading\n\n * A thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, part of the operating system\n \n * A thread is a component of a process\n \n * Multiple threads can exist within one process, executing concurrently and sharing resources such as memory, while different processes do not share these resources\n \n * The threads of a process share its executable code and the values of its dynamically allocated variables and non-thread-local global variables at any given time\n\nTake a loook at:\nhttps://computing.llnl.gov/tutorials/pthreads/\n\n### Examples\n\n[Threads](multithreading/thread.c)\n\n[Processes](multiprocessing/proc.c)\n\n- - - -\n\n## Synchronization\n\n1. Lamport and Dekker algorithms\n2. Atomic operations (TAS)\n3. Semaphores\n4. Mutex\n5. Monitor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsskender%2Funix-posix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsskender%2Funix-posix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsskender%2Funix-posix/lists"}