As shown above, the source and target of edge will be locked before executing scatter function. And if we want to post delta to or clear the gather cache, we should first lock the vertex. My question is: when we change the gather cache in the scatter function, we will try to lock the vertex which has been locked before scatter. Does this behavior always lead to deadlocks? The Pagerank example is shown below.
void scatter(icontext_type& context, const vertex_type& vertex,
edge_type& edge) const {
if(USE_DELTA_CACHE) {
context.post_delta(edge.target(), last_change);
/*In the post_delta function, we should lock the edge target which has been locked before the scatter fcuntion. Is this behavior safe?*/
}
if(last_change > TOLERANCE || last_change < -TOLERANCE) {
context.signal(edge.target());
}
}
As shown above, the source and target of edge will be locked before executing scatter function. And if we want to post delta to or clear the gather cache, we should first lock the vertex. My question is: when we change the gather cache in the scatter function, we will try to lock the vertex which has been locked before scatter. Does this behavior always lead to deadlocks? The Pagerank example is shown below.