-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create IPC locking library @matrixai/js-file-locks
to introduce RWlocks in IPC
#290
Comments
js-lock-fd
)js-lock-fd
in order to introduce inter-process locking and rwlocks
Note that |
js-lock-fd
in order to introduce inter-process locking and rwlocksjs-lock-fd
to introduce RWlocks in IPC
The Here is where the |
As discussed in #283 (comment), there's a problem with |
Just experienced the intermittent
|
I've developed a read-preferring and write-preferring in-memory RWLock for JS: https://gist.github.com/CMCDragonkai/4de5c1526fc58dac259e321db8cf5331 We may even have a general library for locking that incorporates these features. |
Good reference for IPC locking on Linux: https://gavv.github.io/articles/file-locks/#bsd-locks-flock MacOS and Windows might have unique things too. |
This will be the one https://github.com/MatrixAI/js-file-locks will be imported as |
js-lock-fd
to introduce RWlocks in IPC@matrixai/js-file-locks
to introduce RWlocks in IPC
Specification
We'd like to investigate creating our own locking library, based off our current usage of
fd-lock
.Previously we were using both
proper-lockfile
andfd-lock
in a more conglomerated fashion. Now, we are purely usingfd-lock
for theStatus
(our refactored agent lockfile #283) andSession
usage (implemented here).Note the distinction between "locking" here. Here, we're referring to "file locking" (as per the
fd
prefix). For example, for theStatus
, we lock this status file to assert that an agent process is currently executing. Conversely, we're usingasync-mutex
for intra-process locking (locking some resource from within a process, as opposed to between processes). Remember that we also have an existing read-write locking implementation that utilisesasync-mutex
.Our own library should support:
OS-specific read-write locks should be the initial priority, and should be seen as a basic extension of functionality from
fd-lock
(we can use this as a source of inspiration to copy from).Additional context
Tasks
The text was updated successfully, but these errors were encountered: