0

I have multiprocessing python code using multiprocessing.Lock. I would like to change it to have read-write lock instead of simple lock. I was looking for an implementation of it but the only multiple readers / single writer locks I have found in python are based on threading not multiprocessing interface.

My question is does anyone knows if there is a way to use read-write lock in python multiprocessing ?

Diana
  • 86
  • 6
  • Take a look at [multiprocessing-utils](https://pypi.org/project/multiprocessing-utils/) – Darkonaut Nov 02 '18 at 13:55
  • 1
    I do not quite understand why someone can under vote this question. It is a total valid one. There is practically nothing about this topic on internet.... And I think this is essential when you want to improve a little bit the python weak performance – JTejedor Nov 20 '22 at 17:20

1 Answers1

0

Multiprocessing-utils dones't work for me.

There is some third_part read_write_lock which is writed for multiThreading case, u have to make a bit change before it can be used in multiprocessing case.

Here is the code:https://github.com/unhappydog/multiprocessing_read_write_lock/blob/master/rwlock/rwlock.py

spider
  • 49
  • 5