-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
Hello,
I got System.Exception' dans Itinero.dll ("Cannot read elements with an id outside of the accessor range.") in a Parallel.For
Here my code:
int max = 100;
Parallel.For(0, max, ctr =>
{
if (TestMultiThreading(v_origine, v_dest)) Interlocked.Increment(ref v_numFailed);
});
public bool TestMultiThreading(Point p_Origin, Point p_Destination)
{
bool v_Fail = false;
try
{
Route route = new Route();
Profile v_profile = Vehicle.Car.Shortest();
Coordinate v_pointA, v_pointB;
v_pointA = new Coordinate((float)p_Origin.CoordonneeY, (float)p_Origin.CoordonneeX);
v_pointB = new Coordinate((float)p_Destination.CoordonneeY, (float)p_Destination.CoordonneeX);
RouterPoint start, end;
const float DistanceMaxProj = 500.0F;
Router router = new Router(v_routerDB);
start = router.Resolve(v_profile, v_pointA, DistanceMaxProj);
end = router.Resolve(v_profile, v_pointB, DistanceMaxProj);
route = router.Calculate(v_profile, start, end);
}
catch (Exception exc)
{
v_Fail = true;
}
return v_Fail;
}
Regards.
Emmanuel
rodion-m
Metadata
Metadata
Assignees
Labels
No labels