Commit Graph

11 Commits

Author SHA1 Message Date
Martin Molinero 0d35ca8fb9 New data feed work scheduling system
- The new scheduler will create a dedicated thread pool
- Work will be prioritized based on their weight and new items will have
highest priority. The weight will be determined by the size of the
subscription enqueueable.
- The work queue will be sorted and the weights updated by a dedicated
thread
- There will be a maximum weight value that will 'disable' a work item
until their weight comes down
- Consumer will not know about workers or anything alike anymore.
- Applying a general max work queue size of 400 items, this will reduce
CPU and RAM usage. Can be set by config.
2020-01-07 15:21:47 -03:00
Martin Molinero 95abd6bd3a Fix EnqueueableEnumerator hang
- Adding `CancellationTokenSource` to fix a race condition where the worker could stop
after the consumer had already checked on him, see TriggerProducer,
leaving the consumer waiting for ever GH issue 3885. This cancellation token
works as a flag for this particular case waking up the consumer.
- Adding unit tests
2019-12-02 16:50:20 -03:00
Martin Molinero ce3f7ecd41 Replace FileSystem workers Thread for Tasks
- Deleting `ParallelRunnerController` and `ParallelRunnerWorker`.
Replacing them for `Tasks`. The consumer, `EnqueueableEnumerator` will
directly spin up a new producer Task when he is running low on items.
2019-03-04 15:12:46 -03:00
Stefano Raggi 50ab5178e2 Fix threading bug in EnqueueableEnumerator.MoveNext
With the enumerator in blocking mode (backtesting), MoveNext was returning true while Current was being set to null.
This was causing a NullReferenceException in SubscriptionSynchronizer.Sync.
2018-05-25 22:04:35 +02:00
Stefano Raggi 42914249e8 Add missing enumerator disposal when symbol removed from universe
This was causing unnecessary data processing with algorithms using universe selection, so we should expect some improvements in speed and memory usage.

Another less common issue fixed in this PR is unexpected price spikes on symbols with splits.

This fix only affects backtesting, no change in live trading.
2017-06-02 23:18:20 +02:00
Michael Handschuh 6b044f8f6d Make EnqueueableEnumerator disposal thread-safe 2016-03-31 20:00:26 -04:00
snugs 234e76c06f Remove EnqueueableEnumeator.EnqueueRange
Now using BaseDataCollection to ferry universe data around
2015-12-09 15:05:10 -05:00
snugs ad1dba45f6 Performance improvements to backtesting universes
The coarse optimization was removed when universes were made more generic.
2015-12-07 12:02:06 -05:00
snugs 6b136f8fa5 Fixes threading issue in EnqueueableEnumerator 2015-12-07 12:02:05 -05:00
snugs 208c9ceae8 Passing tests FSDF with BaseDataExchange 2015-12-07 12:02:05 -05:00
snugs 252c91f873 Fix spelling of EnqueueableEnumerator 2015-12-07 11:58:46 -05:00