Any recommendations on how to interact with the running state of a program?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Any recommendations on how to interact with the running state of a program?

Anatoly Yakovenko
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Any recommendations on how to interact with the running state of a program?

Anatoly Yakovenko
How would the program get updated values?  via an IORef?  This thing is running until the user decides the output looks good

Anatoly

On Thu, May 28, 2015 at 12:16 PM Carlos López-Camey <[hidden email]> wrote:
Cloud Haskell + Event streaming via some Protocol (like json on websockets) ?



2015-05-25 15:14 GMT-06:00 Anatoly Yakovenko <[hidden email]>:
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Any recommendations on how to interact with the running state of a program?

Charlie Durham
Check out the configurator package:

It has auto reloading of config files through the aptly named autoReload function. Pretty cool stuff. 

Charlie

On Thu, May 28, 2015 at 9:21 PM, Anatoly Yakovenko <[hidden email]> wrote:
How would the program get updated values?  via an IORef?  This thing is running until the user decides the output looks good

Anatoly

On Thu, May 28, 2015 at 12:16 PM Carlos López-Camey <[hidden email]> wrote:
Cloud Haskell + Event streaming via some Protocol (like json on websockets) ?



2015-05-25 15:14 GMT-06:00 Anatoly Yakovenko <[hidden email]>:
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Any recommendations on how to interact with the running state of a program?

Anatoly Yakovenko
Cool, thanks.
But the ChangeHandler would still be modifying some mutable state that some other thread is referencing while it's running. That would still be via an IORef?
I guess this is a similar problem as having a play/pause/skip controls to a video player. Is the interface between the "running" thread and the user triggered events an IORef? Or is there some other way to wrap that.
Thanks,
Anatoly

On Thu, May 28, 2015 at 6:32 PM Charlie Durham <[hidden email]> wrote:
Check out the configurator package:

It has auto reloading of config files through the aptly named autoReload function. Pretty cool stuff. 

Charlie

On Thu, May 28, 2015 at 9:21 PM, Anatoly Yakovenko <[hidden email]> wrote:
How would the program get updated values?  via an IORef?  This thing is running until the user decides the output looks good

Anatoly

On Thu, May 28, 2015 at 12:16 PM Carlos López-Camey <[hidden email]> wrote:
Cloud Haskell + Event streaming via some Protocol (like json on websockets) ?



2015-05-25 15:14 GMT-06:00 Anatoly Yakovenko <[hidden email]>:
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Any recommendations on how to interact with the running state of a program?

Charlie Durham
I think it entirely depends on how you plan to inject the new values into a running program. If you are doing iterations, then it might make sense to do an IOref that contains the entire space of values that may change and then atomically update the whole space when a config update happens. Or maybe you can put each update in a queue inside of an IORef and then do an atomic modify, or I see there is a package providing lockfree queues in hackage. Again, I think it more depends on how you are going about running your program, and where it makes sense to inject new values.

Charlie

On Thu, May 28, 2015 at 9:48 PM, Anatoly Yakovenko <[hidden email]> wrote:
Cool, thanks.
But the ChangeHandler would still be modifying some mutable state that some other thread is referencing while it's running. That would still be via an IORef?
I guess this is a similar problem as having a play/pause/skip controls to a video player. Is the interface between the "running" thread and the user triggered events an IORef? Or is there some other way to wrap that.
Thanks,
Anatoly


On Thu, May 28, 2015 at 6:32 PM Charlie Durham <[hidden email]> wrote:
Check out the configurator package:

It has auto reloading of config files through the aptly named autoReload function. Pretty cool stuff. 

Charlie

On Thu, May 28, 2015 at 9:21 PM, Anatoly Yakovenko <[hidden email]> wrote:
How would the program get updated values?  via an IORef?  This thing is running until the user decides the output looks good

Anatoly

On Thu, May 28, 2015 at 12:16 PM Carlos López-Camey <[hidden email]> wrote:
Cloud Haskell + Event streaming via some Protocol (like json on websockets) ?



2015-05-25 15:14 GMT-06:00 Anatoly Yakovenko <[hidden email]>:
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Any recommendations on how to interact with the running state of a program?

Sylvain HENRY
I would use STM to do that (i.e. put the system variables and the intermediate result in some TVars).

Sylvain

2015-05-29 4:22 GMT+02:00 Charlie Durham <[hidden email]>:
I think it entirely depends on how you plan to inject the new values into a running program. If you are doing iterations, then it might make sense to do an IOref that contains the entire space of values that may change and then atomically update the whole space when a config update happens. Or maybe you can put each update in a queue inside of an IORef and then do an atomic modify, or I see there is a package providing lockfree queues in hackage. Again, I think it more depends on how you are going about running your program, and where it makes sense to inject new values.

Charlie

On Thu, May 28, 2015 at 9:48 PM, Anatoly Yakovenko <[hidden email]> wrote:
Cool, thanks.
But the ChangeHandler would still be modifying some mutable state that some other thread is referencing while it's running. That would still be via an IORef?
I guess this is a similar problem as having a play/pause/skip controls to a video player. Is the interface between the "running" thread and the user triggered events an IORef? Or is there some other way to wrap that.
Thanks,
Anatoly


On Thu, May 28, 2015 at 6:32 PM Charlie Durham <[hidden email]> wrote:
Check out the configurator package:

It has auto reloading of config files through the aptly named autoReload function. Pretty cool stuff. 

Charlie

On Thu, May 28, 2015 at 9:21 PM, Anatoly Yakovenko <[hidden email]> wrote:
How would the program get updated values?  via an IORef?  This thing is running until the user decides the output looks good

Anatoly

On Thu, May 28, 2015 at 12:16 PM Carlos López-Camey <[hidden email]> wrote:
Cloud Haskell + Event streaming via some Protocol (like json on websockets) ?



2015-05-25 15:14 GMT-06:00 Anatoly Yakovenko <[hidden email]>:
I am playing around with some deep learning algorithms and I need a way to periodically read the intermediate result and change some of the system variables.

Any ideas on how to best approach this problem?  I was thinking of something basic, like having the program periodically read and write from some files.

Thanks,
Anatoly

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe