Re: FFI, signals and exceptions

2010-08-26 Thread Edward Z. Yang
Here is a possible implementation: Task *task = NULL; blockedThrowTo(cap,target,msg); if (target-bound) { // maybe not supposed to kill bound threads, but it // seems to work ok (as long as they don't want to try // to recover!) task =

Re: FFI, signals and exceptions

2010-08-26 Thread Simon Marlow
On 26/08/2010 06:57, Edward Z. Yang wrote: Excerpts from Edward Z. Yang's message of Thu Aug 26 01:22:22 -0400 2010: I spent some time looking at the code, and I've been having a difficult time finding the thread ID of the worker thread that is performing the safe FFI call. The target TSO is

HEAD unbuildable

2010-08-26 Thread Johan Tibell
I'm having trouble building HEAD, to the point where even running make clean fails. $ make clean make maintainer-clean make -r --no-print-directory -f ghc.mk clean CLEANING=YES rm -rf inplace rm -rf rm -rf docs/users_guide/users_guide docs/users_guide/users_guide.pdf

Re: FFI, signals and exceptions

2010-08-26 Thread Simon Marlow
On 26/08/2010 08:10, Edward Z. Yang wrote: Here is a possible implementation: Task *task = NULL; blockedThrowTo(cap,target,msg); if (target-bound) { // maybe not supposed to kill bound threads, but it // seems to work ok (as long as they don't want to try

Re: __emutls_get_address link problem

2010-08-26 Thread Christian Maeder
scooter@gmail.com schrieb: Christian: Is it possible that you might have code compiled with an older version of ghc lying around in an odd place in your build hierarchy? I would imagine that you upgraded cabal-installed packages. If for some reason you copied or used rsync to

RE: HEAD unbuildable

2010-08-26 Thread Simon Peyton-Jones
Sorry, my fault. Simon M is fixing S From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Johan Tibell Sent: 26 August 2010 09:08 To: glasgow-haskell-users Subject: HEAD unbuildable I'm having trouble building HEAD, to the point where

late optimization of typeclass callers

2010-08-26 Thread Christian Höner zu Siederdissen
Hi, I do have the problem that my code is not completely optimized. We begin with -- Ring.hs class Ring a where rmult :: a - a - a zero :: a -- PrimitiveArray.hs class PrimArrayOps a b where data PrimArray a b :: * unsafeIndex :: PrimArray a b - a - b -- PAInstances.hs -- for any 'a'

Re: FFI, signals and exceptions

2010-08-26 Thread Edward Z. Yang
Excerpts from Simon Marlow's message of Thu Aug 26 04:08:06 -0400 2010: You don't want to do this for a bound thread (when target-bound != NULL), because the OS thread will have interesting things on its C stack and pthread_cancel discards the entire stack. A worker thread on the other

Re: FFI, signals and exceptions

2010-08-26 Thread Edward Z. Yang
Ahem, the logic in that last iteration was not quite correct. Here is the more correct version: case BlockedOnCCall: case BlockedOnCCall_NoUnblockExc: { #ifdef THREADED_RTS Task *task = NULL; if (!target-bound) { // walk all_tasks to find the correct worker