[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-05 Thread Simon Marlow
Bulat Ziganshin wrote: Wednesday, May 3, 2006, 3:07:19 PM, you wrote: I propose to add INLINE pragmas to withMVar and friends. and to any higher-order function? :) imho, key of this problem is that GHC don't have a way to optimize just the required function with all it's enclosed calls. i

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-04 Thread Simon Marlow
Bulat Ziganshin wrote: after Simon's message i thought about this problem. i found several situations where "restoring" of locked file will be useful: - using stdout and other standard handles. we may need to print error message or just continue work despite the exception abandoned our previous

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-04 Thread Simon Marlow
John Meacham wrote: On Wed, May 03, 2006 at 12:07:19PM +0100, Simon Marlow wrote: This won't affect Handle I/O unfortunately, because we need block to protect against asynchronous exceptions. I'm still not certain you won't need that in the stream library, too: check any stateful code (eg..

Re[2]: [Haskell-cafe] Re: Optimizing locking with MVars

2006-05-03 Thread Bulat Ziganshin
Hello John, Thursday, May 4, 2006, 12:33:54 AM, you wrote: >> This won't affect Handle I/O unfortunately, because we need block to >> protect against asynchronous exceptions. I'm still not certain you >> won't need that in the stream library, too: check any stateful code (eg. >> buffering) and

Re: [Haskell-cafe] Re: Optimizing locking with MVars

2006-05-03 Thread John Meacham
On Wed, May 03, 2006 at 12:07:19PM +0100, Simon Marlow wrote: > This won't affect Handle I/O unfortunately, because we need block to > protect against asynchronous exceptions. I'm still not certain you > won't need that in the stream library, too: check any stateful code (eg. > buffering) and i

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-03 Thread Simon Marlow
This is interesting, thanks. I propose to add INLINE pragmas to withMVar and friends. Having an interface for simple locks sounds like a good idea to me. Would you like to send a patch? This won't affect Handle I/O unfortunately, because we need block to protect against asynchronous exceptio