Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread blocked indefinitely in an MVar operation (HP 2013 ghc 7.6.3 on mac) with current monad par via criterion #31

Open
cartazio opened this issue Jun 24, 2013 · 6 comments

Comments

@cartazio
Copy link

This is the issue i reported in Criterion haskell/criterion#28 and mistakenly in an older closed monad-par ticket.

Likely hit via Criterion calling the following function in Statistics that is the only use of Monad par in Criterion or Statistics haskell/criterion#28

@cartazio
Copy link
Author

I'm sorry, I mean the only use site of monad par in Criterion and Statistics is https://github.com/bos/statistics/blob/master/Statistics/Resampling/Bootstrap.hs#L87-L90

so it seems very very likely its a monad par problem

@cartazio
Copy link
Author

I'm happy to help someone else narrow this bug down, but I'm not familiar with much of GHC concurrency stuff (as yet), so help would be appreciated

simonmar added a commit that referenced this issue Jul 19, 2013
Works around these issues with the direct scheduler: #27, #31, #32
@gatoatigrado
Copy link

Hi, I'm seeing possibly-related issues with ParIO; is there any way to switch that to the Trace scheduler as well? I tried substituting Direct with Trace (in the latest Github checkout) and that doesn't seem to work [ http://pastebin.com/ww7KZSS9 -- sorry I can't interpret the error ].

Sorry I haven't reduced it to a minimal use case, but my use of monad-par is just to do a parallel map (essentially, mapM get =<< mapM (spawn . liftIO . worker_task) inputs). I'm using read-only functionality on Data.HashTable objects (IO flavor, hashtables package), so I don't see how that'd be not thread-safe.

Thanks in advance for your input.

@cartazio
Copy link
Author

@gatoatigrado have you tried using the newest version on hackage? http://hackage.haskell.org/package/monad-par-0.3.4.3

@simonmar
Copy link
Owner

I've just uploaded 0.3.4.4 which switches the ParIO monad over to the Trace scheduler too.

@gatoatigrado
Copy link

Hi Dr. Marlow, That seems to fix the problem for me. Thank you very much!! Sorry I couldn't / can't share example codes (I was doing a proof-of-concept project at my work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants