A good design pattern, I think, is to have a Haskell thread dedicated to
each socket. It can suck on the socket and dump what it finds into an
STM channel or buffer. Then other threads (the ones doing the work) can
read it transactionally.
It should be find to have lots of threads, esp if
| Andrew Pimlott:
| //about my highly spiritual essay on lazy computing of PI//:
|
| In addition to being clever and terribly funny, the conclusion
| foreshadows (inspired?) later work on Enron [1].
|
| Come on, it is improbable that Master Simon ever read my essay...
I hadn't before, but I
This is exactly what I do. I use hGetBuf with a timeout. I do not
compile with -threaded, should I? Does it change anything?
Also, is there a way to somehow stick all the sockets that I read
from into a select to monitor input on any of them and wake up a
thread once input becomes
On 26.11 22:00, Dimitry Golubovsky wrote:
Thanks Duncan for this link: a very interesting reading.
Duncan Coutts wrote:
Are you aware of the XCB library:
http://xcb.freedesktop.org/
I managed to parse the XCB XML protocol descriptions to
Haskell data structures, next I'll try to emit
On Unix with -threaded, all blocking I/O using Handles or sockets goes
via the I/O manager thread, which multiplexes all the blocked I/O
requests into a single select() call. If you have 20k blocked socket
reads, there will be 20k lightweight Haskell threads, and probably 2 or
3 real OS threads.
Einar,
Are you talking about packet handling level only (i. e. same as I have
now), or do you also have any of their transport algorithms (lazy
request sending/response retrieval) implemented?
Einar Karttunen wrote:
I managed to parse the XCB XML protocol descriptions to
Haskell data
On Nov 28, 2005, at 11:32 AM, Simon Marlow wrote:
On Unix with -threaded, all blocking I/O using Handles or sockets goes
via the I/O manager thread, which multiplexes all the blocked I/O
requests into a single select() call. If you have 20k blocked socket
reads, there will be 20k lightweight
On 28 November 2005 11:47, Joel Reymont wrote:
On Nov 28, 2005, at 11:32 AM, Simon Marlow wrote:
On Unix with -threaded, all blocking I/O using Handles or sockets
goes via the I/O manager thread, which multiplexes all the blocked
I/O requests into a single select() call. If you have 20k
This may be a stupud question, but how to make I/O in Haskell really lazy?
Here is a simple program:
module Main where
import System.IO
import Foreign
import Data.Word
import Data.Char
s2c :: String - [Word8]
s2c s = map (fromIntegral . ord) s
sendstr :: Handle - String - IO Int
On Mon, Nov 28, 2005 at 07:27:44AM -0500, Dimitry Golubovsky wrote:
Any ideas, pointers?
unsafeInterleaveIO does what you want.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello, I have a program that just will not compile and I cannot figure
out why. I am starting out with wxHaskell but keep getting certain
errors. Here is the source:
-
module Main where
import Graphics.UI.WX
main :: IO ()
main = start hello
hello :: IO ()
hello = do
On Nov 27, 2005, at 2:36 PM, Bill Wood wrote:
(I'm going to do a lazy permute on your stream of consciousness;
hope it
terminates :-).
I think the Rubicon here is the step from one to many -- one
function/procedure to many, one thread to many, one processor to
many, ... . Our favorite pure
mempko [EMAIL PROTECTED] writes:
Hello, I have a program that just will not compile and I cannot figure
out why.
Wrong indentation. Tab stops are 8 spaces in Haskell, but your code
seems to assume 6 spaces.
-
module Main where
import Graphics.UI.WX
main :: IO
Am Montag, 28. November 2005 13:27 schrieb Dimitry Golubovsky:
[...]
What is desired is to have the IO actions perform as their results are
needed. I am assuming some knowledge that those actions have only
limited scope of side effects (e. g. order of outputs within a window is
significant,
Hello all,
I read an article on using perl for live improvised synthesis a
while ago (http://www.perl.com/pub/a/2004/08/31/livecode.html). Does
anyone have thoughts in doing this is haskell? Would strong typing make
jazzy programming too difficult?
Regards,
Echo Nolan
signature.asc
Folks,
How would you implement a timed read from a channel with STM? I would
like to return Timeout if nothing was read from a TChan in X ms.
Is this a basic two-thread timeout implementation or is there a more
elegant way of implementing this using `orElse`?
Thanks, Joel
--
Although Haskore (haskell.org/haskore) doesn't currently support
real-time music, it's something I've thought about numerous times in the
past, and wish I had the time to do it...
-Paul Hudak
Echo Nolan wrote:
Hello all,
I read an article on using perl for live improvised
On Mon, Nov 28, 2005 at 11:27:46PM +, Joel Reymont wrote:
Folks,
How would you implement a timed read from a channel with STM? I would
like to return Timeout if nothing was read from a TChan in X ms.
Is this a basic two-thread timeout implementation or is there a more
elegant way
18 matches
Mail list logo