Giter Club home page Giter Club logo

cloudhaskell's People

Contributors

acfoltzer avatar aslatter avatar basvandijk avatar jepst avatar kfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudhaskell's Issues

Spawned Processes can't spawn another process.

Right now spawned processes can't spawn new proceses. Is this something that will be possible when the Static is implemented or is it something I'm doing wrong?
Here's an example:

{-# LANGUAGE TemplateHaskell,BangPatterns,PatternGuards,DeriveDataTypeable #-}
module RecSpawn where

import Remote.Call
import Remote.Channel
import Remote.Peer
import Remote.Process
import Remote.Init
import Remote.Encoding

import System.Random(randomRIO)
import Control.Monad.Trans(liftIO)

spawner :: ProcessM ()
spawner = do
  thisNode <- getSelfNode -- This could also be a remote node
  flag <- liftIO $ randomRIO (0,1) :: ProcessM Int
  case flag of
    0 -> spawn thisNode (spawner__closure)
    1 -> say "Got one"

remotable ['spawner]

initial _ = do spawnLocal spawner
               return ()

main = remoteInit Nothing [RecSpawn.__remoteCallMetaData] initial

Make ProcessM a transformer (or add MonadProcessM)

In some examples I've been writing, I've been trying to use StateT MyState ProcessM (). Generally the issue with this is that all of the ProcessM stuff has to be lifted. So there are two solutions.

Make ProcessM a transformer so I can use MonadState.

Add a MonadProcessM class I can instance my monad stack with so I can lift the stuff up automatically.

Or, you know, both.

[MacOS]Promises lost when there are more promises than worker nodes?

I have an embarassingly parallel computing task implemented in a CloudHaskell:

runTask $ do mapM (newPromise ยท mapper) inputs
mapResult โ† mapM readPromise pmapResult

This works ok, as long as there are as many WORKER processes, as (length inputs - 1),
but if I have fewer, I get:
2012-08-23 10:57:06.030153 CEST 2 pid://localhost:57840/11/ SYS Process got unhandled exception TaskException "Failed promise redemption"
2012-08-23 10:57:06.030586 CEST 2 pid://localhost:57840/8/ SYS Process got unhandled exception ProcessMonitorException: pid://localhost:57840/11/ has terminated because SrException "TaskException "Failed promise redemption""

As tutorials are rather sparse, I wonder how may I fix it? (And why?)

Interestingly enough the exception doesn't appear on Linux, and everything completes okay.

Mac OS X also shows another exception for each node:
2012-08-23 10:56:57.86235 CEST 2 pid://localhost:57837/5/ SYS Process got unhandled exception bind: resource busy (Address already in use)

Question about ProecessM monad

I've been digging through the sources of Cloud Haskell trying to
understand what it is about - it looks nice.

On the Picky-details side of things, it looks like the ProcessM Monad
is set up similar to a State monad, but it could almost be a Reader
Monad, except for the functions 'setLogConfig' and 'buildPid'. If it
weren't for these functions, ProcessM could be defined as:

newtype ProcessM a = ProcessM {runProcessM :: Process -> IO a} deriving Typeable

which would simplify the implementation (and perhaps improve the
performance of (>>=) and friends).

It looks like 'buildPid' is only called when a process doesn't know
which port it is listening on. It's a bit hard for me to follow the
process creation code - if there was a way for the parent process
which creates the child to calculate the port before-hand instead of
after the fact the monad stack could be trimmed down.

For 'setLogConfig', we could just put the local log config in an MVar
and be done with it.

This would change the semantics of 'forkProcessWeak' - changes to the
log config after calling 'forkProcessWeak' would be seen in both
threads.

Since 'forkProcessWeak' is only used in one place which doesn't this
shouldn't be a problem.

Anyway I'm probably missing something about how process creation
works, so there might e a reason this isn't a good approach.

Config File

Would it be possible to expose a config type instead of requiring a file?

Also, allowing some sort of option to use a different transport for connections (use case i have in mind right now is TLS).

Mutable state thats local for each node.

Hi again.
I'm writing a Chord DHT using your Cloud Haskell.
When doing this each node in the DHT needs a local state that all processes can access. (even those spawned from remote processes.)
Right now, this is implemented by a hack of mine exploiting the fact that the pid of the first process you run in
Cloud Haskell is static. That way I store state in that process and all spawned processes can get/put the state
using custom messages. You can see an example implementation in my fork in examples/Chord/Test.hs
You need to export the ProcessId data constructor to make it work.

This hack works quite well and has never failed on my tests, there's just two bugs as I see it now.

  • Each get/put need to serialize the state, then send it to the other process. This is quite heavy compared to an MVar.
  • I can't store the state in a MVar because they can't be serialized.
  • Theres a chance of state corruption since there's no locks. Could be implemented, but if I did, I'd end up with virtually
    a MVar that can be sent between processes. In your paper you write that that would be "doing it wrong."

Do you have any idea about how one would add state for each node. I've taken a look at the code in Process.hs and
functions like getSelfPid already access a state-like structure. Would it be possible to add inn a MVar there that's inherited from
the node state each time a new process is spawned? I tried to do this but that would have broken the signatures of several
top level functions in Cloud Haskell. Both spawnLocalAnd, startLocalRegistry and initNode etc. This because one would have
to have a initial node state all these places. I also got a problem with polymorphism, because the state type had to have a
defined type at compile time. I ended up concluding I was "doing it wrong" and needed some help from someone that knows
the code. What's your thoughts on this problem?

This is not an urgent issue for me in any way, just putting forth the idea. Afterall I have working state ;)

ProcessId, NodeId, etc lack Data instance

These types are used so commonly in message types, it would be nice if they had Data instances so we could use genericGet, genericPut on them. It's a trivial change, but it can't be done by users because the constructors are not exported. Alternatively, export the constructors so we can just add a deriving instance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.