Timeline for Scheduling using System.IObservable 2.0
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 19, 2018 at 9:25 | vote | accept | CommunityBot | moved from User.Id=73941 by developer User.Id=8983 | |
Apr 19, 2018 at 9:23 | comment | added | user73941 | Your suggestion for a timer algorithm does not solve the problem, and it has some undesirable side effects too. So I'll stick to mine until some better comes up. About 10) - it is intentionally, and Paralle.ForEach doesn't add any useful to that part. Thanks for the review - your points are all worth considering. | |
Apr 19, 2018 at 9:07 | history | edited | Nikita B | CC BY-SA 3.0 |
added 609 characters in body
|
Apr 19, 2018 at 8:59 | comment | added | Nikita B |
@HenrikHansen this is accurate. However sometimes it can be really hard to predict and/or know for sure what the current execution context is or what it is going to be in the future. So it is a good idea to just always be explicit, when it comes to StartNew method and schedulers.
|
|
Apr 19, 2018 at 8:52 | comment | added | user73941 | I admit that I'm not that familiar to the details of Tasks and Schedulers, so I have to rely on the documentation and it states that the Current returns Default if not set otherwise (in a encapsulating Task). I'll have to dive into that. | |
Apr 19, 2018 at 8:42 | comment | added | Nikita B | @HenrikHansen, I've edited my answer to address some of your other concerns. | |
Apr 19, 2018 at 8:42 | history | edited | Nikita B | CC BY-SA 3.0 |
added 136 characters in body
|
Apr 19, 2018 at 8:30 | history | edited | Nikita B | CC BY-SA 3.0 |
added 136 characters in body
|
Apr 19, 2018 at 8:23 | history | edited | Nikita B | CC BY-SA 3.0 |
added 260 characters in body
|
Apr 19, 2018 at 8:13 | comment | added | Nikita B |
@HenrikHansen, As I understand it, StartNew(() => {}, TaskCreationOptions.LongRunning) just starts on the default scheduler this is exactly the misconception that the article talks about. No it does not use Default scheduler. All TaskFactory methods use Current scheduler by default unless specified otherwise. Whether or not it matters when you run a LongRunning task (which, to my knowledge, should always run on newly created thread) is a different question. I just made sure you are aware of this pitfall.
|
|
Apr 19, 2018 at 7:58 | history | edited | Nikita B | CC BY-SA 3.0 |
added 46 characters in body
|
Apr 19, 2018 at 5:50 | comment | added | user73941 | 6) OK, The counter shouldn't dispatch ticks if no one really cares. Start/Stop can be handled internally. 7) We just disagree on that :-) 8) I'm not sure if HSecondCounter is a very good name either 9) I'm not sure if you have read my explanation/discussion in the first version of this post. If you have then please update your answer with some code that shows a realiable solution. | |
Apr 19, 2018 at 5:49 | comment | added | user73941 |
5) Stephen is always worth reading. I use StartNew() instead of just Run() , for the parameter TaskCreationOptions.LongRunning . After rereading the documentation for that setting, I'm not sure, it's the right thing to do. As I understand it, StartNew(() => {}, TaskCreationOptions.LongRunning) just starts on the default scheduler, and that seems OK here. Factory.StartNew(action) == Task.Run(action) . One could claim that such a potentially long running task (a HScheduler could be running for years) should be running on a normal thread instead?
|
|
Apr 19, 2018 at 5:49 | comment | added | user73941 | 1) Where do you mean?; 2) OK, 3) Array.ForEach needs a lock, IsClosed why racing condition(?) (Dispose() == Close()) 4) The try...catch is for exceptions in HScheduler and for unhandled exceptions in job.Action(...). The (ex) => ... is for errors comming from HSecondCounter (The error message is a little misleading) | |
Apr 18, 2018 at 17:33 | comment | added | user73941 | Thanks for feedback. I'll come back with comments soon... | |
Apr 18, 2018 at 13:52 | history | answered | Nikita B | CC BY-SA 3.0 |