itinero / reminiscence

A library for cross-platform memory mapping.
MIT License
9 stars 6 forks source link

Enable readonly-access to Index from multiple threads. #6

Open xivk opened 7 years ago

xivk commented 7 years ago

Related to:

https://github.com/itinero/routing/issues/55

xivk commented 6 years ago

The problem is in the accessor implementation, we should use another implementation when working without a backing-stream:

https://github.com/itinero/reminiscence/blob/master/src/Reminiscence/IO/Accessors/MappedAccessorInt16.cs#L47

juliusfriedman commented 4 years ago

Is this related to https://github.com/itinero/routing/issues/256 as well?

juliusfriedman commented 4 years ago

@xivk, https://github.com/itinero/reminiscence/pull/23 highlights a test which fails when accessing index in parallel, I tried to look into it but couldn't get far as of yet. I made my comments in the PR.

I am assuming this issue is related to that same thing or is this a new issue?

juliusfriedman commented 4 years ago

Also if the buffer is used couldn't there be a caching mechanism which checks to see if the value is already in the buffer and just read it from there rather than the stream? I am not quite sure how to implement this ... It might already be implemented to some degree as that unit test shows, after first enumeration the parallel tests don't exhibit the issue...