-
Notifications
You must be signed in to change notification settings - Fork 123
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
Lock plugin #578
Lock plugin #578
Conversation
@@ -0,0 +1,15 @@ | |||
- infos = Information about the lock plugin is in keys below | |||
- infos/author = Kurt Micheli <e1026558@student.tuwien.ac.at> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you want to use that e-mail address? I think they shut it down when you leave TU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don not have a proper email, can I have a @libelektra.org
mail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have sent you an e-mail to your new address!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Thank you! |
Btw. nice plugin, is this really your first one? Where there any difficulties? |
Btw. I think we found a use case for this kind of plugin: When we do not have or should not (NFS) rely on timestamps this could be useful. Your strategy would already work if only the So following tasks would be required to make a plugin for NFS-conflict detections out of it:
@tom-wa do you have some further suggestions regarding NFS? |
I update the plugin in this PR to the ordered global plugin, the |
Btw. yes the first plugin, got the knowledge from reviewing and the copy-template works fine. |
|
||
A semaphore is used for the synchronisation and the implemented algorithm favors the writer, | ||
because updates should be propagated soon as possible and a `kdbSet` is more expansive than | ||
a `kdbGet`. This expansiveness comes from merging and conflict solving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to favor the writers (because readers should get up-to-date information), but I cannot follow your explanation. Do you mean expensive instead of expansive? What has the run-time cost to do with preference?
merging is not a part of kdbSet
, but validation is.
Looks really nice! Can you rename it to semlock? Btw. the simple-lock: plugin names should be a-z0-9 only, so maybe longlock? Did you try to run it with the race test? |
I tried but failed, it seems that the global hooks are being called a little weird. I inserted printfs in the kdb.c, when the hooks get called and configured the global plugins that semlock is the only plugin and I get this output:
Note that the Also I am worried about:
in kdb.c:770. Without releasing set call no other process can make a get. |
The placement of hooks is an ongoing discussion, see #555. I even thought about giving special placement especially for lock plugins (lockgetstorage, ..., unlocksetstorage). This would ensure that locks are always executed before and after any other plugins (without needing to resort of some weird ordering constructs). Thus these global locking plugins are not really useful as "normal" plugins, we would not really lose something that way. And this way we could place the global plugins specifically in mind that it will always unlock if it was locked before. (and avoid such problems as in kdb.c:770) |
We should discuss that topic after the meeting tomorrow. I will create an issue for the longlock, as reminder for me. |
I adjusted the tags and rating. I think it can be merged. |
Thank you! Let us discuss it tomorrow. |
No description provided.