You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by Douglas Service <ds...@gmail.com> on 2016/09/02 02:33:49 UTC

.NET Core Timmer issues

I am working on JIRA-1554 which replaces the C# System.Timers.Timer class
with System.Threading.Timer. Unfortunately only the version that takes 32
bit "due time" and "period" parameters is available in .NET Core (I
verified this on the .NET Core website) however the parameters passed to
the TimerStage class both in Java and C# are longs.

This still gives users a maximum timeout of 2^32/1000 = 4294967 seconds =
1193 hours = 49.7 days. Which seems like long enough for a REEF job.
Comments?

The documentation for the timer class says

The method specified for *callback* should be reentrant, because it is
called on ThreadPool
<https://msdn.microsoft.com/en-us/library/system.threading.threadpool(v=vs.110).aspx>
threads.
The method can be executed simultaneously on two thread pool threads if the
timer interval is less than the time required to execute the method, or if
all thread pool threads are in use and the method is queued multiple times.


Does anyone know what the original design requirements were for the the
TimerStage and RXTimerStage classes? A search on timer stage does not
reveal any usage of the classes in REEF.

Doug

Re: .NET Core Timmer issues

Posted by Mariia Mykhailova <ma...@microsoft.com>.
I don't think right now there are REEF jobs running more than 49 days. But there might be such jobs in future (why not?). And this constraint will be hidden so well that people who try to create a long-running REEF job will have a really hard time figuring it out.


-Mariia

________________________________
From: Douglas Service <ds...@gmail.com>
Sent: Thursday, September 1, 2016 7:33:49 PM
To: dev@reef.apache.org
Subject: .NET Core Timmer issues

I am working on JIRA-1554 which replaces the C# System.Timers.Timer class
with System.Threading.Timer. Unfortunately only the version that takes 32
bit "due time" and "period" parameters is available in .NET Core (I
verified this on the .NET Core website) however the parameters passed to
the TimerStage class both in Java and C# are longs.

This still gives users a maximum timeout of 2^32/1000 = 4294967 seconds =
1193 hours = 49.7 days. Which seems like long enough for a REEF job.
Comments?

The documentation for the timer class says

The method specified for *callback* should be reentrant, because it is
called on ThreadPool
<https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fsystem.threading.threadpool(v%3dvs.110).aspx&data=02%7c01%7cmamykhai%40microsoft.com%7c5ebbf527498141ffd61908d3d2d994d3%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c636083804371600420&sdata=JlPwItfnd546hCng22hNTr5FtTfcGaW6gh1ltUpRRAI%3d>
threads.
The method can be executed simultaneously on two thread pool threads if the
timer interval is less than the time required to execute the method, or if
all thread pool threads are in use and the method is queued multiple times.


Does anyone know what the original design requirements were for the the
TimerStage and RXTimerStage classes? A search on timer stage does not
reveal any usage of the classes in REEF.

Doug

Re: .NET Core Timmer issues

Posted by Mario Inchiosa <mi...@gmail.com>.
Since RxTimerStage is not used on either the Java or C#
side, `[Obsolete]`'ing it and subsequently deleting sounds good.
Since TimerStage is used a lot on the Java side, it might make sense to
keep it on the C# side, and Doug has already made it .NET Core-compliant.

On Tue, Sep 20, 2016 at 5:57 PM, Douglas Service <ds...@gmail.com> wrote:

> The TimerStage class is used in the following tests on the java side.
>
>    - PubSubThreadPoolStageTest.java
>    - TimerStageTest.java
>    - LargeMsgTest.java
>    - RemoteManagerTest.java
>    - RemoteTest.java
>    - SmallMessagesTest.java
>    - TransportRaceTest.java
>    - TransportTest.java
>
> though it is not used on the C# side. However, The test code on the C# side
> appears to be incomplete compared to the java side so I am reticent to
> delete a class that we may need to provide complete test coverage on the C#
> side.
>
> The RxTimeStage class class on the other hand is not used on either the
> java or C# side so I agree we should [Osolete] the RxTimerClass and
> subsequently delete it both in Java and C#. Java
>
> The difference between TimerStage and RxTimerStage classes is that
> TimerStage calls EventHandler<PeriodicEvent> instance whereas calls an
> IStaticObservable for time out events.
>
> Doug
>
> On Thu, Sep 8, 2016 at 3:12 PM, Markus Weimer <ma...@weimo.de> wrote:
>
> > On Thu, Sep 1, 2016 at 7:33 PM, Douglas Service <ds...@gmail.com>
> wrote:
> > > Does anyone know what the original design requirements were for the the
> > > TimerStage and RXTimerStage classes? A search on timer stage does not
> > > reveal any usage of the classes in REEF.
> >
> > Maybe we should `[Obsolete]` them and delete them subsequently?
> >
> > Markus
> >
>

Re: .NET Core Timmer issues

Posted by Douglas Service <ds...@gmail.com>.
The TimerStage class is used in the following tests on the java side.

   - PubSubThreadPoolStageTest.java
   - TimerStageTest.java
   - LargeMsgTest.java
   - RemoteManagerTest.java
   - RemoteTest.java
   - SmallMessagesTest.java
   - TransportRaceTest.java
   - TransportTest.java

though it is not used on the C# side. However, The test code on the C# side
appears to be incomplete compared to the java side so I am reticent to
delete a class that we may need to provide complete test coverage on the C#
side.

The RxTimeStage class class on the other hand is not used on either the
java or C# side so I agree we should [Osolete] the RxTimerClass and
subsequently delete it both in Java and C#. Java

The difference between TimerStage and RxTimerStage classes is that
TimerStage calls EventHandler<PeriodicEvent> instance whereas calls an
IStaticObservable for time out events.

Doug

On Thu, Sep 8, 2016 at 3:12 PM, Markus Weimer <ma...@weimo.de> wrote:

> On Thu, Sep 1, 2016 at 7:33 PM, Douglas Service <ds...@gmail.com> wrote:
> > Does anyone know what the original design requirements were for the the
> > TimerStage and RXTimerStage classes? A search on timer stage does not
> > reveal any usage of the classes in REEF.
>
> Maybe we should `[Obsolete]` them and delete them subsequently?
>
> Markus
>

Re: .NET Core Timmer issues

Posted by Markus Weimer <ma...@weimo.de>.
On Thu, Sep 1, 2016 at 7:33 PM, Douglas Service <ds...@gmail.com> wrote:
> Does anyone know what the original design requirements were for the the
> TimerStage and RXTimerStage classes? A search on timer stage does not
> reveal any usage of the classes in REEF.

Maybe we should `[Obsolete]` them and delete them subsequently?

Markus