Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real world example of using os.plock?

Tags:

python

locking

Are there any real world usages for using os.plock from a Python application?

I really can't imagine for what it could be used, not even talking about real world use cases...

like image 402
dom0 Avatar asked Dec 06 '25 19:12

dom0


1 Answers

The thing that you would normally use process or memory locking for is to avoid the OS swapping to disk. In the case of a memlock this could be data used for cryptographic purposes that shouldn't be written (even temporarily) to a form of more permanent storage. In the case of a large process, this could also include the processes stack, or other "segments" that should remain only in memory.

like image 117
Jon Clements Avatar answered Dec 08 '25 08:12

Jon Clements



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!