typedef boost::numeric::ublas::compressed_matrix< double, boost::numeric::ublas::row_major > MatType;
MatType mat; // both threads use the same matrix object.
VecType a1, b1, a2, b2;
// ... assemble matrix and vectors ...
// ...
// thread 1 code:
axpy_prod( mat, a1, b1, true );
// thread2 code:
axpy_prod( mat, a2, b2, true );