Commit Graph
25 Commits
Author SHA1 Message Date
Marcos Henrich 54844b08ef Refactored AddToAny and TakeFromAny to reuse code. 2014-10-08 12:59:42 +01:00
Marcos Henrich 7724a608a5 Improved BlockingCollection.AddAny. Fixes #22775.
AddAny no longer consumes OperationCanceledException.
AddAny no longer blocks while adding an item to the first collection when its full.
2014-10-08 12:16:36 +01:00
Marcos Henrich 00c918e0a9 BlockingCollection.Add was adding one more item than it should. 2014-10-08 11:51:59 +01:00
Miguel de Icaza 705da187cf [System] Fix build warnings 2014-05-04 17:15:18 -04:00
Rodrigo Kumpera e03314480d [bcl] Fix BlockingCollection.TakeFromAny to handle when no items are available on the first collection. Fixes #6095. 2013-09-12 16:42:53 -04:00
Rodrigo Kumpera 4f41e84fde [bcl]Switch BlockingCollection to do CAS over ints and not longs.
The reasoning behind doing CAS on longs was to avoid overflowing
which is not a problem because 2-completement math does the trick.

This is much more reliable than using longs on 32 bits.
2013-09-03 17:03:59 -04:00
Rodrigo Kumpera 0923ad6b26 [bcl]Switch BlockingCollection to use SequentialLayot to make sure its longs are 8 bytes aligned everywhere. 2013-09-03 16:29:32 -04: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
Miguel de Icaza 58cb859143 Bring Parallel LINQ to the Mobile profile 2012-11-06 18:18:12 -05:00
Jérémie Laval 516a087a4c [System] Fix timeout in BlockingCollection. Fix #6732. 2012-09-04 14:43:58 +01:00
Jérémie Laval 093ed98316 Fix .NET 4 API 2011-01-06 16:08:31 +00:00
Marek Safar d84d7c7eb9 Remove no longer used BOOTSTRAP conditionals 2010-12-29 12:41:12 +00:00
Jérémie Laval a4ce700a64 Refactor Add/Take/TryAdd/TryTake methods into a common block in BlockingCollection 2010-12-09 16:00:15 +00:00
Jérémie Laval 4a43b8e34d Fix GetConsumingEnumerable exception handling in BlockingCollection 2010-12-09 16:00:15 +00:00
Guillaume Pouillet 0d98fbbe29 Fix bug in BlockingCollection<T>.TryTake Add corresponding unit test 2010-12-07 11:24:03 +01:00
Jérémie Laval 0e91816c02 Adapt deep sleep operation in BlockingCollection and fix Try* method (simplest form) behavior 2010-08-19 18:47:45 +01:00
Jérémie Laval e582a526ff Add some documentation to BlockingCollection 2010-08-19 18:45:08 +01:00
Jérémie Laval 3e4304d36e Fix two minor exception misusages in BlockingCollection. 2010-08-03 21:54:37 +02:00
Jérémie Laval a0448d4148 [Fix] Add deep-sleep to BlockingCollection using two ManualResetEventSlim for signaling when waiting in "collection-is-full-while-adding" and "collection-is-empty-while-taking" scenarios. Should definitely fix #624849. 2010-08-03 21:54:36 +02:00
Jérémie Laval fc315f7699 Sanitize use of CancellationToken in BlockingCollection. 2010-08-03 21:54:36 +02:00
Jérémie Laval e5638be38c Switch from per-thread SpinWait instance to per-method-call instance 2010-07-29 12:52:10 +02:00
Jérémie Laval 0d765d035d 2010-04-15 Jérémie Laval <[email protected]>
In class/System/System.Collections.Concurrent/:
   * BlockingCollection.cs:
   * ConcurrentBag.cs: Add BOOTSTRAP_NET_4_0

In class/System/System.Threading/:
   * Barrier.cs: Add BOOTSTRAP_NET_4_0

In class/corlib/System.Collections.Concurrent/:
   * ConcurrentDictionary.cs:
   * ConcurrentSkipList.cs:
   * OrderablePartitioner.cs:
   * Partitioner.cs: Add BOOTSTRAP_NET_4_0 define

In class/corlib/System.Collections/:
   * IStructuralComparable.cs:
   * IStructuralEquatable.cs: Add BOOTSTRAP_NET_4_0 define

In class/corlib/System.Threading.Tasks/:
   * Future.cs:
   * Task.cs:
   * TaskCanceledException.cs:
   * TaskContinuationOptions.cs:
   * TaskCreationOptions.cs:
   * TaskFactory.cs:
   * TaskScheduler.cs:
   * TaskStatus.cs: Add BOOTSTRAP_NET_4_0 define

In class/corlib/System.Threading/:
   * AtomicBoolean.cs:
   * CountdownEvent.cs:
   * SpinLock.cs: Add BOOTSTRAP_NET_4_0 define

In class/corlib/System/:
   * Tuple.cs:
   * Tuples.cs: Add BOOTSTRAP_NET_4_0 define

svn path=/trunk/mcs/; revision=155531
2010-04-15 19:01:26 +00:00
Marek Safar 1bad3c9e1b 2009-12-03 Marek Safar <[email protected]>
* BlockingCollection.cs, ConcurrentBag.cs: Updated to Beta 2 API.


svn path=/trunk/mcs/; revision=147544
2009-12-03 10:36:22 +00:00
Jérémie Laval e828ffcda6 2009-08-19 Jérémie Laval <[email protected]>
In class/System/System.Collections.Concurrent/:
   * BlockingCollection.cs: Rewrite to use a transaction id
   based approach. Ported to 4.0 API. Fix GetConsumingEnumerable.

In class/System/Test/System.Collections.Concurrent/:
   * BlockingCollectionTests.cs: Track API changes.

In class/System/System.Threading/:
   * Barrier.cs: Fix Barrier to be really thread-safe.
   Remove deadlocking.

In class/corlib/System.Collections.Concurrent/:
   * Partitioner.cs: Fix infinite recursion when calling Create
   with a IList.
   * Partitionners/ListPartitioner.cs: Fix bad splitting for the
   last partition.

In class/corlib/System.Threading.Tasks/:
   * Task.cs: Refactor Wait methods.

In class/corlib/System.Threading/:
   * AtomicBoolean.cs: Turn it into a class
   * CountdownEvent.cs: Work on cached variable. Make sure
   count doesn't go under 0.
   * ParallelLoopState.cs: Initialize correctly AtomicBoolean.

svn path=/trunk/mcs/; revision=140229
2009-08-19 10:51:42 +00:00
Jérémie Laval 9bf30cecff 2009-08-11 Jérémie Laval <[email protected]>
* Update unit tests
    * Moved BlockingCollection and Barrier in System.dll (with assorted fixes)
    * Fix wrong signature in TaskFactory<T>
    * Update .dll.sources files
    * Move AggregateException in System namespace
    * Remove While in Parallel
    * Correct Wait(CancellationToken) signature in CountdownEvent
    * update corlib.dll.sources

svn path=/trunk/mcs/; revision=139727
2009-08-11 18:47:31 +00:00