Commit Graph
31 Commits
Author SHA1 Message Date
Rodrigo Kumpera 0acb81dc64 [bcl] Replace more long fields with int to make them CAS friendly on 32 bits systems. 2013-09-04 14:47:27 -04:00
Marek Safar 1fe24728bd Optimize common path 2013-08-19 10:22:22 +02:00
Rodrigo Kumpera 1b92a4148c Since MOBILE implies NET_4_* now, take this into account and simplify our ifdefs. 2013-02-11 18:42:18 -05:00
Konrad M. Kruczynski 73ca5b067f Another fix and unit test added.
Now all three possible cases are tested (and working).
2012-04-23 15:44:16 +02:00
Konrad M. Kruczynski 83c06e2b22 Fixes as per the Rodrigo's comment.
Wait now throws an exception in case of cancellation token was
cancelled.
2012-04-23 12:02:09 +02:00
Konrad M. Kruczynski e6e63c0aa6 Fix for bug in ManualResetEventSlim.
The problem occured when one waited for an event with the
cancellation token and the wait was successful but not
immediate. In that case Wait returned false instead of true,
because of wait handle number mismatch. Also the unit test was
added.
2012-04-22 22:24:14 +02:00
Jeremie Laval 9738fcb590 Improve ManualResetEventSlim consistency with new algorithm 2012-04-11 14:58:21 +01:00
Jeremie Laval 38c3d85451 Remove now useless barriers in ManualResetEventSlim since Interlocked do the job for us
Related to f8b8ea08f6
2012-04-10 12:48:03 +01:00
Jeremie Laval f8b8ea08f6 Switch from boolean to count mode to safely detect disposability in ManualResetEventSlim.
Having two concurrent operations of Set/Reset who succeeded in fetching the handle before it was disabled all the while trying to dispose may have caused a early release of the handle.
2012-04-10 12:39:02 +01:00
Marek Safar 57fc0680d5 Fix few races in ManualResetEventSlim and make it compatible with .net 2011-10-18 17:45:33 +01:00
Marek Safar fa8e1b0785 Compatibility fixes to CountdownEvent 2011-10-17 17:07:07 +01:00
Jérémie Laval 868cff3cb1 Make ManualResetEventSlim Dispose/(Set,Reset) combo a bit safer. Add unit test. 2011-10-15 21:13:36 +02:00
Jérémie Laval d691e17299 Update ManualResetEventSlim to handle disposal correctly 2011-10-14 14:50:52 +02:00
Jérémie Laval 4770b24fa9 Tune Marek's work on Task.WaitAny, Task.Wait and Task.WaitAll 2011-10-13 21:42:21 +02:00
Jérémie Laval f81cd730a0 Avoid possible races in ManualResetEventSlim in case handle was already created but not with correct value 2011-02-02 15:07:45 +00:00
Geoff Norton 83e999b7d7 Add pfx to the mobile profile 2011-01-25 01:51:17 -05:00
Jérémie Laval 4ce910052b Add missing Debugger and ReliabilityContract attributes to .NET 4 types 2011-01-06 16:07:48 +00:00
Marek Safar d84d7c7eb9 Remove no longer used BOOTSTRAP conditionals 2010-12-29 12:41:12 +00:00
Jérémie Laval ed404a7b74 More parameter renaming 2010-12-15 16:39:58 +00:00
Jérémie Laval 7e01c4b1be Adjust sleeping values 2010-11-26 14:10:04 +00:00
Jérémie Laval fe0be24bea Final performance improvement on ReaderWriterLockSlim 2010-11-10 13:38:55 +00:00
Jérémie Laval bf297d5546 ManualResetEventSlim performance improvements 2010-11-04 15:51:33 +00:00
Jérémie Laval da356a6008 Remove timed deep sleep in ManualResetEventSlim and instead combine several WaitHandle to wait on 2010-08-19 16:07:05 +01:00
Jérémie Laval 2abec426fe Move NET_4_0 define checks at the right position under the licence text 2010-08-13 16:25:20 +01:00
Jérémie Laval 5a6df750a7 Lazy initialization of ManualResetEventSlim's underlying kernel object.
It avoids allocating kernel ressources when the standard fast path is used which is the main goal of this type.
2010-08-13 11:32:35 +01:00
Jérémie Laval af30815fc9 Add missing BOOTSTRAP_NET_4_0 define check in ManualResetEventSlim (as BlockingCollection now depends on that type). 2010-08-04 00:48:19 +02:00
Jérémie Laval bc9c912418 Correctly use ManualResetEventSlim's kernel-based counterpart to deep sleep when too much has already been spent spinning.
Instead of using solely SpinWait's SpinOnce method after ManualResetEventSlim's spinCount is reached, it now uses ManualResetEvent's WaitOne method. Various other checks like CancellationToken canceled state are still verified during that time albeit slower.
2010-08-03 21:54:32 +02:00
Jérémie Laval 21b8c50c28 Use directly CancellationToken's ThrowIfCancellationRequested in ManualResetEventSlim 2010-08-03 21:54:31 +02:00
Jérémie Laval e531fc2677 2010-02-02 Jérémie Laval <[email protected]>
In class/corlib/:
   * corlib.dll.sources: Add System.Threading.Tasks/SimpleConcurrentBag.cs
   and System.Threading.Tasks/UnobservedTaskExceptionEventArgs.cs

In class/corlib/System.Collections.Concurrent/:
   * ConcurrentDictionary.cs:
   * ConcurrentQueue.cs:
   * ConcurrentStack.cs:
   * Partitioner.cs: Port to .NET 4 beta 2 API
   * ConcurrentSkipList.cs: Use Monitor for locking

In class/corlib/System.Threading.Tasks/:
   * Future.cs:
   * Parallel.cs:
   * ParallelLoopState.cs:
   * Task.cs:
   * TaskCompletionSource.cs:
   * TaskContinuationOptions.cs:
   * TaskCreationOptions.cs:
   * TaskFactory.cs:
   * TaskScheduler.cs:
   * UnobservedTaskExceptionEventArgs.cs: Port to .NET 4 beta 2 API
   * SimpleConcurrentBag.cs: Add a simpler implementation of ConcurrentBag
   for use with parallel loops as ConcurrentBag was moved to System

In class/corlib/System.Threading/:
   * CancellationToken.cs:
   * CancellationTokenSource.cs:
   * ManualResetEventSlim.cs:
   * SemaphoreSlim.cs:
   * SpinLock.cs:
   * SpinWait.cs:
   * ThreadLocal.cs: Port to .NET 4 beta 2 API

In class/corlib/System/:
   * AggregateException.cs:
   * OperationCanceledException.cs: Port to .NET 4 beta 2 API

In class/corlib/Test/System.Collections.Concurrent/:
   * CollectionStressTestHelper.cs:
   * ConcurrentBagTests.cs:
   * ConcurrentDictionaryTests.cs:
   * ConcurrentQueueTests.cs:
   * ConcurrentSkipListTests.cs:
   * ConcurrentStackTests.cs:
   * ParallelConcurrentQueueTests.cs:
   * ParallelConcurrentStackTests.cs: Update namespaces and tested methods

In class/corlib/Test/System.Threading.Tasks/:
   * FutureTests.cs:
   * ParallelTestHelper.cs:
   * ParallelTests.cs:
   * SnziTests.cs:
   * TaskCompletionSourceTests.cs:
   * TaskTest.cs: Update namespace and tested methods

In class/corlib/Test/System.Threading/:
   * CancellationTokenTests.cs:
   * LazyInitTests.cs:
   * ThreadLazyTests.cs: Update namespace and tested methods

svn path=/trunk/mcs/; revision=150716
2010-02-02 17:06:15 +00:00
Jérémie Laval 7baa3c7178 In class/corlib/:
* corlib.dll.sources: Added TaskCompletionSource
        * corlib_test.dll.sources: Removed SnziTests due to
		visibility change in Snzi.
        Added TaskCompletionSource tests.

In class/corlib/System.Collections.Concurrent/:
        * ConcurrentBag.cs:
        * ConcurrentQueue.cs:
        * ConcurrentStack.cs:
        * ConcurrentSkipList.cs:
        * ConcurrentDictionary.cs:
        * IProducerConsumerCollection.cs: Make the namespace comply to 4.0b1

In class/corlib/System.Threading.Tasks/:
        * Task.cs:
        * Future.cs:
        * TaskFactory.cs:
        * TaskCanceledException.cs:
        * TaskSchedulerException.cs:
        * Internal/SchedulerProxy.cs: Make System.Threading.Tasks API fully 4.0 b1 compliant.
        * TaskCompletionSource.cs: Add TaskCompletionSource class

In class/corlib/System.Threading/:
        * Snzi.cs:
        * Parallel.cs:
        * SpinLock.cs:
        * SpinWait.cs:
        * ThreadLocal.cs:
        * SemaphoreSlim.cs:
        * CountdownEvent.cs:
        * ManualResetEventSlim.cs:
        * CancellationTokenSource.cs: Various 4.0 b1 API mismatch fixes.

In class/corlib/Test/System.Collections.Concurrent/:
        * ConcurrentDictionary: Ignore tests until runtime/compiler
        is fixed

svn path=/trunk/mcs/; revision=139206
2009-07-31 18:08:49 +00:00
Jérémie Laval b5d889b654 Author: Jérémie Laval <[email protected]>
Date:   Thu Jul 30 15:37:21 2009 +0200

First code drop of ParallelFx.

svn path=/trunk/mcs/; revision=139083
2009-07-30 13:56:32 +00:00