liburing
liburing copied to clipboard
File shared/exclusive lock/unlock
I am adding this here to keep track of this topic.
If we could have functions like io_uring_prep_lock()
and io_uring_prep_unlock()
for file locking/unlocking using something like IOSQE_IO_LINK
to join few sequence together.
It would really be nice if this can be in Linux 5.6 :)
5.6 is feature locked at this point, and not sure I'll have time to work on this for 5.7. So 5.8 is a more realistic target, I'm afraid.
Locking and unlocking is very important part of the project i wanted to use Liburing in :(
Sorry, there's really nothing I can do, 5.6 is totally closed, it's bug fixes only after the merge window. And I've got other items I'm working on, hence I'm not going to promise anything for 5.7. Just trying to manage your expectations.
No worries... I will just have to rig a temp fix for now :)
Locking/unlocking and directory contents listing (getdents64 https://github.com/axboe/liburing/issues/111) is the first wave an totally uring drived io app will meet.
@axboe if I was to try and implement flock
support in io_uring, where should I look? Blocking the worker thread is a bad idea, so we probably need to somehow do a callback on lock acquisition instead. I suspect this is not possible at the moment and going to require quite a lot of quite involved work and I should stay away from it given my very limited kernel development experience? :)
flock
is fd
lock vs pid
lock (commonly used). This could easily be used if fcntl
was implemented https://github.com/axboe/liburing/issues/199 Its a chain of dependencies :)
Lock is only a lock as long as other software in your system also use the same method
I am adding this here to keep track of this topic.
If we could have functions like
io_uring_prep_lock()
andio_uring_prep_unlock()
for file locking/unlocking using something likeIOSQE_IO_LINK
to join few sequence together.It would really be nice if this can be in Linux 5.6 :)
are sucess exclusive unlock script ? you run own web ?
@imanthaashan77
are sucess exclusive unlock script ?
I am not sure what you are asking! None the less... I am currently using an atomic counter to reserve space, this way no external fd/pid lock/unlock system needs to be used, also its much faster, of course this is only viable within the software. External process can still alter the file.
you run own web ?
Lock/unlock is for file write not for web use.
Any way we can help with this?