minolin / acplugins

R&D about the upcoming server plugin infrastrucure of Assetto Corsa, driving simulator by Kunos simulazioni
Apache License 2.0
18 stars 4 forks source link

Possible bugfix for CollisionBag and Suggestions #12

Closed flitzi closed 8 years ago

flitzi commented 8 years ago
flitzi commented 8 years ago

To be honest I think it's very unlikely that this really was the problem with the Collisions, but these changes shouldn't hurt either.

The problem with the threadlocking was mainly that reading and writing DateTime struct is not atomic so you might read corrupt values.

flitzi commented 8 years ago

the locking with bag.lockObject is done to make sure that TryAdd and the check in the Loop in StartNew is not done in parallel which might cause Problems.

Yes, the ThreadPool has less overhead and in our cases here there should there shouldn't be any delay.

minolin commented 8 years ago

Thank you then!