Cyanure has quit [Remote host closed the connection]
Vinnipeg has joined #ocaml
vivanov has quit [Quit: Lost terminal]
avsm has joined #ocaml
mfp has joined #ocaml
digimmortal has quit [Ping timeout: 252 seconds]
Vinnipeg has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
vivanov has joined #ocaml
Snark has quit [Quit: Ex-Chat]
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 255 seconds]
vivanov has quit [Read error: No route to host]
ikaros has quit [Quit: Ex-Chat]
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 276 seconds]
Boscop_ is now known as Boscop
sepp2k has joined #ocaml
ztfw has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
vivanov has joined #ocaml
sepp2k has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
<krktz>
why doesnt type ('r, 'f) foo = 'r 'f ;; work? (syntax error on the ' of 'f)
SoftTimur has joined #ocaml
SoftTimur has quit [Read error: Operation timed out]
SoftTimur has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
xarch_ has joined #ocaml
avsm1 has quit [Quit: Leaving.]
<flux>
perhaps you mean 'r * 'f
<flux>
oh, you mean higher order type?
<flux>
those aren't supported, sorry. perhaps the module system will help you.
sepp2k has joined #ocaml
fraggle_ has joined #ocaml
bzzbzz has quit [Quit: leaving]
impy has quit [Read error: Connection reset by peer]
Snark has joined #ocaml
ikaros has joined #ocaml
zorun has joined #ocaml
SoftTimur has left #ocaml []
avsm has joined #ocaml
dnolen has joined #ocaml
Tobu has quit [Ping timeout: 258 seconds]
Tobu_ has joined #ocaml
Tobu_ has quit [Changing host]
Tobu_ has joined #ocaml
<NaCl>
rproust: I probably don't get Lwt enough to figure this out, but how would I go about making a global sleeping thread tht I could wake up with avalue?
<avsm>
let t,u = Lwt.task () in
<avsm>
(* t sleeps forever until its woken up by.. *)
<avsm>
Lwt.wakeup u "wakeup";
<avsm>
lwt result = t in printf "result=%s\n" result
* NaCl
still doesn't get this whole "cooperative thread" thing
<avsm>
it does take some getting used to
<avsm>
just imagine that everything is either running, or waiting to be woken up by something
<avsm>
your system runs until it has nothing to do, and then it just blocks in a select () loop to wake up one of the sleepers
<avsm>
in the example above, the only thing that can wake up 't' is someone calling Lwt.wakeup on u
<NaCl>
well, I'm writing a GUI. xD
<avsm>
but there are other ways threads can be woken up, like a file descriptor becoming active, or a timeout firing
<avsm>
well, a GUIs a bit of an advanced thing to use Lwt for, since it usually requires combining event loops
<avsm>
i would get familiar with it by writing some simple network servers...
<NaCl>
hasn't been too much of a problems
<NaCl>
except sometimes it's hard to figure out what will block the mainloop and what won't
<NaCl>
especially when I'm firing off other processes and waiting for them to finish
<NaCl>
avsm: wait, how would I set that up in a function call? I meanm, I'm trying to wake up the threadm have it do something, then go back to sleep
<NaCl>
loop forever
<avsm>
wake it up, do its something, then allocate another Lwt.task()
<avsm>
you need to register those wakeners somewhere, so just reregister the new one
<NaCl>
register?
lamawithonel has quit [Ping timeout: 255 seconds]
<avsm>
what woke up the thread?
<NaCl>
the "wakener"
<avsm>
it needs to have a reference to the Lwt.u, to invoke Lwt.wakeup
<NaCl>
the thread is just one "statement"?
<avsm>
i dont think of these as threads, really
<NaCl>
with "let t,u = Lwt.task () in do_something_cool ()"
<NaCl>
it would sleep on the "do_something_cool ()" part, but t and u would be accessible after the fact?
lamawithonel has joined #ocaml
<avsm>
let t, u = Lwt.task () in do_something_cool (); t in
<avsm>
would do something cool and then sleep until woken up
<avsm>
the 't' is the important one; it's the mini-thread that blocks
<avsm>
and Lwt.wakeup u () will wake up the thread with ()
<NaCl>
then after that, the function can loop back on itself, after the reference to the wakener has been updated?
lamawithonel has quit [Excess Flood]
lamawithonel has joined #ocaml
<avsm>
yup
<NaCl>
or I could bind t to call the function again, where it would sleep after the reference is updated?
<NaCl>
Actually, I have to head out, I'll bbiab.
<NaCl>
Thanks for the help.
lamawithonel has quit [Excess Flood]
lamawithonel has joined #ocaml
<NaCl>
next step is figuring out how to set up the reference, but I'll look at that later
Cyanure has joined #ocaml
avsm has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
Smerdyakov has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
Snark has quit [Quit: Ex-Chat]
vivanov has quit [Quit: Lost terminal]
lamawithonel has quit [Remote host closed the connection]
rgee has joined #ocaml
lamawithonel has joined #ocaml
vivanov has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
lamawithonel_ has joined #ocaml
lopex has joined #ocaml
lamawithonel_ has quit [Ping timeout: 240 seconds]
lamawithonel_ has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 255 seconds]
rgee has quit [Ping timeout: 260 seconds]
lamawithonel__ has quit [Remote host closed the connection]
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 255 seconds]
cthuluh has quit [Ping timeout: 260 seconds]
cthuluh has joined #ocaml
vivanov has quit [Quit: Lost terminal]
cthuluh has quit [Quit: @#$%!]
lamawithonel__ has quit [Remote host closed the connection]
lamawithonel__ has joined #ocaml
Boscop_ is now known as Boscop
mjonsson has joined #ocaml
cthuluh has joined #ocaml
rgee has joined #ocaml
axiles has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]
lopex has quit []
avsm has joined #ocaml
othiym23 has joined #ocaml
Boscop has quit [Quit: OutOfTimeException: Allocation of TimeFrame failed due to lack of time. Free up time by cancelling unimportant events.]
lamawithonel__ has quit [Ping timeout: 264 seconds]
lamawithonel__ has joined #ocaml
Boscop has joined #ocaml
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
joewilliams_away is now known as joewilliams
alfa_y_omega has joined #ocaml
jamii has joined #ocaml
Smerdyakov has joined #ocaml
Cyanure has joined #ocaml
Cyanure has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
mjonsson has quit [Remote host closed the connection]
ztfw has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
jamii has quit [Read error: Operation timed out]
Morphous_ has quit [Ping timeout: 258 seconds]
fraggle_ has quit [Remote host closed the connection]