<p dir="ltr">Hi Richard,</p>
<p dir="ltr">  Yes, it works, this is what osrm-routed does, there is only a single instance of the OSRM object shared between multiple threads:</p>
<p dir="ltr"><a href="https://github.com/Project-OSRM/osrm-backend/blob/develop/src/tools/routed.cpp#L105">https://github.com/Project-OSRM/osrm-backend/blob/develop/src/tools/routed.cpp#L105</a></p>
<p dir="ltr">  It works either with the internal facade, or the shared memory option.</p>
<p dir="ltr">Daniel</p>
<div class="gmail_quote">On Jan 20, 2016 8:25 PM, "Richard Marsden" <<a href="mailto:winwaed@gmail.com">winwaed@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it possible to have multi-threaded (i.e. multiple simultaneous)<br>
calls using the C++ library interface?<br>
<br>
E.g. with one "OSRM" object shared between the threads; or with<br>
multiple OSRM objects, one per thread?<br>
<br>
Presumably the latter case would be memory hungry, but enabling<br>
shared_memory in the libosrm_config would help...?<br>
<br>
The scenario I'm looking at would use the same road/graph files.<br>
<br>
<br>
<br>
Richard Marsden<br>
<br>
_______________________________________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br>
</blockquote></div>