Boost logo

Ublas :

Subject: Re: [ublas] vector / matrix thread write access
From: Vardan Akopian (vakopian_at_[hidden])
Date: 2010-08-30 20:57:53


uBlas containers are definitely not thread safe, so you need to
implement your own synchronization, by keeping a lock (possible a
read-write lock) when accessing the container. You could use the Boost
Thread library for that purpose.

On Mon, Aug 30, 2010 at 6:54 AM, Kraus Philipp
<philipp.kraus_at_[hidden]> wrote:
> Hi,
>
> I use a ublas::vector for caching some data between threads. One of my
> threads sould write data into a position of the vector and the other thread
> should be read the data. In some cases more than one thread can write to the
> vector on the same position. Every thread that sets the data creates the
> same data, so it is irrelevant which thread writes.
>
> Are ublas::matrix and ublas::vector for reading and writing on the same
> indexposition thread-safe?
> If they are not, how can I make them thread-safe?
>
> Thanks
>
> Phil
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: vakopian_at_[hidden]
>