[Lemon-user] thread safety
Alpár Jüttner
alpar at cs.elte.hu
Fri Aug 24 10:47:00 CEST 2012
Hi,
> I wonder where I can find the documentation on the thread safety of
> Lemon library.
LEMON uses a thread safety model similar to STL. The official support
will come with the upcoming release 1.3, the documentation doesn't exist
yet.
> I use a SmartGraph and define some maps on it.
The support for allocating maps for the same graph from different
threads will come with version 1.3, but it's already usable in the
development version.
If you don't need this feature, you can safely use the latest stable
release.
> I want to update the data on the map in parallel.
In that case you may need to apply a mutex by yourself, similarly to
STL, see below.
> The order of the update does not matter to me. Can I use pthread
> together with Lemon?
Yes, you can.
> What is the read/write safety of the updates on the map?
You can think of a map as an std::vector<>, it provides the same
read/write safety:
* You can safely read it in parallel.
* You can safely write different positions in parallel.
* If you want to read/write the same position in parallel, you
will most probably need a mutex.
Regards,
Alpar
>
> Thank you for your help,
> Wei
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
More information about the Lemon-user
mailing list