Fixed #41/2
Removed min hard cap for MaxDegreeOfParallelism
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Barotrauma
|
||||
|
||||
private static readonly ParallelOptions parallelOptions = new ParallelOptions
|
||||
{
|
||||
MaxDegreeOfParallelism = Math.Max(4,Environment.ProcessorCount - 1),
|
||||
MaxDegreeOfParallelism = Math.Max(1,Environment.ProcessorCount - 1),
|
||||
};
|
||||
|
||||
#if CLIENT
|
||||
|
||||
@@ -1145,4 +1145,4 @@ namespace FarseerPhysics.Collision
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FarseerPhysics.Collision;
|
||||
using FarseerPhysics.Dynamics.Contacts;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace FarseerPhysics.Dynamics
|
||||
{
|
||||
@@ -61,6 +62,8 @@ namespace FarseerPhysics.Dynamics
|
||||
public int CollideMultithreadThreshold = 64;
|
||||
#endregion
|
||||
|
||||
// This will ensure only one thread will work on ContactList so that we wont mess up these stuff
|
||||
private readonly SemaphoreSlim contactManagerSignal = new SemaphoreSlim(1);
|
||||
|
||||
/// <summary>
|
||||
/// Fires when a contact is created
|
||||
@@ -249,6 +252,8 @@ namespace FarseerPhysics.Dynamics
|
||||
|
||||
internal void Destroy(Contact contact)
|
||||
{
|
||||
contactManagerSignal.Wait(100);
|
||||
|
||||
Fixture fixtureA = contact.FixtureA;
|
||||
Fixture fixtureB = contact.FixtureB;
|
||||
Body bodyA = fixtureA.Body;
|
||||
@@ -310,6 +315,8 @@ namespace FarseerPhysics.Dynamics
|
||||
// Insert into the pool.
|
||||
contact.Next = _contactPoolList.Next;
|
||||
_contactPoolList.Next = contact;
|
||||
|
||||
contactManagerSignal.Release();
|
||||
}
|
||||
|
||||
internal void Collide()
|
||||
@@ -610,4 +617,4 @@ namespace FarseerPhysics.Dynamics
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Kastellanos Nikolaos
|
||||
// Copyright (c) 2017 Kastellanos Nikolaos
|
||||
|
||||
/* Original source Farseer Physics Engine:
|
||||
* Copyright (c) 2014 Ian Qvist, http://farseerphysics.codeplex.com
|
||||
@@ -496,4 +496,4 @@ namespace FarseerPhysics.Dynamics.Contacts
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1726,4 +1726,4 @@ namespace FarseerPhysics.Dynamics
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user