{"id":19447668,"url":"https://github.com/mqudsi/rwlock","last_synced_at":"2025-04-25T01:32:53.963Z","repository":{"id":141840712,"uuid":"2557751","full_name":"mqudsi/RWLock","owner":"mqudsi","description":"Lightweight read-write locks for thread synchronization on Windows that run on Windows XP and up.","archived":false,"fork":false,"pushed_at":"2024-02-07T18:31:39.000Z","size":24,"stargazers_count":23,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T06:43:53.960Z","etag":null,"topics":["ipc","rwlock","win32"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mqudsi.png","metadata":{"files":{"readme":"README","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}},"created_at":"2011-10-11T19:46:11.000Z","updated_at":"2024-03-10T11:16:53.000Z","dependencies_parsed_at":"2023-03-12T20:00:38.803Z","dependency_job_id":null,"html_url":"https://github.com/mqudsi/RWLock","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/mqudsi%2FRWLock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mqudsi%2FRWLock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mqudsi%2FRWLock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mqudsi%2FRWLock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mqudsi","download_url":"https://codeload.github.com/mqudsi/RWLock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223976787,"owners_count":17234892,"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":["ipc","rwlock","win32"],"created_at":"2024-11-10T16:19:05.366Z","updated_at":"2024-11-10T16:19:06.044Z","avatar_url":"https://github.com/mqudsi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"RWLock is a C++ library meant to provide light-weight read-write locks\nfor Windows thread synchronization. RWLock is intended to be both\nversatile and lightweight, and comes in a few different flavors.\n\nRWLock is developed and maintained by Mahmoud Al-Qudsi\n\u003cmqudsi@neosmart.net\u003e of NeoSmart Technologies \u003chttp://neosmart.net/\u003e\n\nPthread's rwlock objects provide a high-performance means of allowing\neither multiple readers to access a resource simultaneously or a\nsingle writer. Windows did not have an equivalent thread\nsynchronization primitive until Windows Vista was released. However,\nmost software developers still target Windows XP and above, so this\nlibrary should come in handy to fill in the gap.\n\nNon-IPC RWLock() implementations will automatically use Microsoft's\nSRW Locks behind the scene if run on Windows Vista or above.\n\nUnlike pthread_rwlock_t and SRW Locks, RWLock can also be used for\ninterprocess read-write synchronization via placement of a single\nintptr_t object memory-mapped or stored in a shared data segment.\n\nUsage:\n\nRWLock comes in four distinct flavors, each with different features\nand different performance characteristics.\n\nAll four RWLock implementations share a common locking/unlocking API,\nthough they differ somewhat in initialization:\n\nvoid StartRead();\nvoid EndRead();\nvoid StartWrite();\nvoid EndWrite();\n\nThe usage is completely straight-forward. Readers call StartRead() to\naccess a shared resource for reading and EndRead() at the end of\naccessing the shared resource. Writers do the same with StartWrite()\nand EndWrite(). These functions take no parameters and return no\nvalues.\n\nThe different RWLock flavors are listed below, from fastest to\nslowest. You should use the fastest object that meets your\nrequirements:\n\n\n1. RWLock()\n\n* This is the fastest and lightest RWLock flavor \n\n* RWLock cannot be used for cross-process synchronization\n\n* RWLock does not support reentrance(StartRead() being called multiple\n  times by the same thread before EndRead() is called)\n\n* RWLock does not support calling StartRead() after calling\n  StartWrite() but before calling EndWrite()\n\n* On Windows Vista/7/8, this RWLock implementation will dynamically\n  switch to an SRW Lock underneath the hood for optimum performance.\n\n\n2. RWLockReentrant()\n\n* RWLockReentrant supports reentrance\n\n* RWLockReentrant supports calling StartRead() after StartWrite()\n\n* RWLockReentrant cannot be used for cross-process synchronization\n\n* On Windows Vista/7/8, this RWLock implementation will dynamically\n  switch to an SRW Lock underneath the hood for optimum performance.\n\n\n3. RWLockIPC(intptr_t *lock, LPCTSTR guid)\n\nlock: pointer to an intptr_t object located in a shared data segment\n\nguid: unique string used to create the named synchronization objects\n\n* RWLockIPC can be used for cross-process synchronization\n\n* RWLockIPC does not support reentrance\n\n* RWLockIPC does not support calling StartRead() after calling\n  StartWrite()\n\n\n4. RWLockIPCReentrant(intptr_t *lock, LPCTSTR guid)\n\nlock: pointer to an intptr_t object located in a shared data segment\n\nguid: unique string used to create the named synchronization objects\n\n* RWLockIPCReentrant can be used for cross-process synchronization\n\n* RWLockIPCReentrant supports reentrance\n\n* RWLockIPCReentrant supports calling StartRead() after calling\n  StartWrite()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmqudsi%2Frwlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmqudsi%2Frwlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmqudsi%2Frwlock/lists"}