Skip to content

File locking strategy #15

@elebeaup

Description

@elebeaup

Currently, read and write operations in FileStorage class are thread-safe. Before accessing the read or write methods, the thread acquires an intrinsic lock and releases the lock when the method returns. So, two threads cannot perfom a read or a write operation in parallel even if it is a different file.
To improve it, one possible solution is to implement a shared Lock using ReadWriteLock The read-lock prevents the acquisition of a write lock by another thread. More than one thread can read (and hold a read-lock simultaneously) at the same time. By contrast, a write lock prohibits all other operations while a write operation.

What do you think about it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions