2016-12-14 23:34 GMT+01:00 Himanshu Chatterjee <
himanshu....@gmail.com>:
> Hi,
Hi
> Is it possible that multiple readers in multiple processes, can do
> pmemobj_open() on the same file simultaneously ?
No, currently it's not possible.
> I tried that with reader.c
> example but found only first process gets success and all other processes
> gets "resource unavailable" error.
This is because we are locking the file on open, so 2nd open gets EWOULDBLOCK
error from flock(2).
> Also is it caller responsibility to
> serialize read and write on a piece of PMEM memory or libpmemobj has those
> serialization built
It's a responsibilty of an application. Pmemobj exposes pmem locks to let you
protect your data structures from simultaneous access (from multiple threads).
> And is it even possible to simultaneously open such
> file for writing and reading and caller or libpmemobj serializes, writer and
> reader based on the the memory region granularity.
I don't understand the question. Could you rephrase?
Marcin