mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
jlouis_ has joined #ocaml
smimou has quit ["bli"]
jlouis has quit [Connection timed out]
baruk has joined #ocaml
jlouis has joined #ocaml
ita is now known as ita|zzz
jlouis_ has quit [Read error: 110 (Connection timed out)]
ita|zzz has quit [Remote closed the connection]
seafoodX has joined #ocaml
baruk has quit [kornbluth.freenode.net irc.freenode.net]
kelaouch1 has quit [kornbluth.freenode.net irc.freenode.net]
rwmjones has quit [kornbluth.freenode.net irc.freenode.net]
aij has quit [kornbluth.freenode.net irc.freenode.net]
bla has quit [kornbluth.freenode.net irc.freenode.net]
slipstream-- has quit [kornbluth.freenode.net irc.freenode.net]
zmdkrbou has quit [kornbluth.freenode.net irc.freenode.net]
crabstick has quit [kornbluth.freenode.net irc.freenode.net]
fremo has quit [kornbluth.freenode.net irc.freenode.net]
Amorphous has quit [kornbluth.freenode.net irc.freenode.net]
cmeme has quit [kornbluth.freenode.net irc.freenode.net]
ramkrsna has quit [kornbluth.freenode.net irc.freenode.net]
hcarty has quit [kornbluth.freenode.net irc.freenode.net]
Oatschool has quit [kornbluth.freenode.net irc.freenode.net]
jlouis has quit [kornbluth.freenode.net irc.freenode.net]
joshcryer has quit [kornbluth.freenode.net irc.freenode.net]
Sparkles has quit [kornbluth.freenode.net irc.freenode.net]
TaXules has quit [kornbluth.freenode.net irc.freenode.net]
eck has quit [kornbluth.freenode.net irc.freenode.net]
haelix has quit [kornbluth.freenode.net irc.freenode.net]
bebui has quit [kornbluth.freenode.net irc.freenode.net]
eroyf has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
olegfink has quit [kornbluth.freenode.net irc.freenode.net]
schme has quit [kornbluth.freenode.net irc.freenode.net]
simon has quit [kornbluth.freenode.net irc.freenode.net]
l_a_m has quit [kornbluth.freenode.net irc.freenode.net]
lde has quit [kornbluth.freenode.net irc.freenode.net]
netx has quit [kornbluth.freenode.net irc.freenode.net]
mbishop has quit [kornbluth.freenode.net irc.freenode.net]
diakopter has quit [kornbluth.freenode.net irc.freenode.net]
gunark has quit [kornbluth.freenode.net irc.freenode.net]
pantsd has quit [kornbluth.freenode.net irc.freenode.net]
Mr_Awesome has quit [kornbluth.freenode.net irc.freenode.net]
screwt8 has quit [kornbluth.freenode.net irc.freenode.net]
Abo-Marwan has quit [kornbluth.freenode.net irc.freenode.net]
pango has quit [kornbluth.freenode.net irc.freenode.net]
mattam has quit [kornbluth.freenode.net irc.freenode.net]
gim has quit [kornbluth.freenode.net irc.freenode.net]
noss has quit [kornbluth.freenode.net irc.freenode.net]
pattern has quit [kornbluth.freenode.net irc.freenode.net]
gaja has quit [kornbluth.freenode.net irc.freenode.net]
seafoodX has quit [kornbluth.freenode.net irc.freenode.net]
threeve has quit [kornbluth.freenode.net irc.freenode.net]
jonathanv has quit [kornbluth.freenode.net irc.freenode.net]
tsuyoshi has quit [kornbluth.freenode.net irc.freenode.net]
seafoodX has joined #ocaml
jlouis has joined #ocaml
baruk has joined #ocaml
pantsd has joined #ocaml
threeve has joined #ocaml
crabstick has joined #ocaml
jonathanv has joined #ocaml
Demitar has joined #ocaml
olegfink has joined #ocaml
joshcryer has joined #ocaml
Mr_Awesome has joined #ocaml
screwt8 has joined #ocaml
Abo-Marwan has joined #ocaml
slipstream-- has joined #ocaml
schme has joined #ocaml
kelaouch1 has joined #ocaml
pango has joined #ocaml
Sparkles has joined #ocaml
gaja has joined #ocaml
bla has joined #ocaml
rwmjones has joined #ocaml
aij has joined #ocaml
tsuyoshi has joined #ocaml
mattam has joined #ocaml
eck has joined #ocaml
gim has joined #ocaml
fremo has joined #ocaml
simon has joined #ocaml
Amorphous has joined #ocaml
noss has joined #ocaml
l_a_m has joined #ocaml
cmeme has joined #ocaml
lde has joined #ocaml
ramkrsna has joined #ocaml
zmdkrbou has joined #ocaml
netx has joined #ocaml
mbishop has joined #ocaml
hcarty has joined #ocaml
Oatschool has joined #ocaml
diakopter has joined #ocaml
TaXules has joined #ocaml
eroyf has joined #ocaml
bebui has joined #ocaml
haelix has joined #ocaml
gunark has joined #ocaml
pattern has joined #ocaml
seafoodX has quit []
mordaunt has joined #ocaml
EliasAmaral has joined #ocaml
<EliasAmaral> A thread created with Thread.create can't send anything to stdout? This code doesn't generate any output: http://pastebin.com/m3b7da9a
<EliasAmaral> (should output the strings "ha!\n" and "hu!\n" in any order)
<tsuyoshi> don't you need to flush stdout somehow?
<EliasAmaral> i don't know, http://pastebin.com/d26aa4911 doesn't work either
<EliasAmaral> tsuyoshi, i think the program isn't allowed to exit without flushing stdout
[azoic] has joined #ocaml
<tsuyoshi> hmm the other thing is, you aren't waiting for the threads to complete before exiting
<tsuyoshi> try joining the threads
<EliasAmaral> but when the computation of _ finalizes, the other threads are floating around, so the program shouldn't be allowed to exit either. (that is, i think a program may exit only if it has no running threads)
<EliasAmaral> hmm
<tsuyoshi> I don't think so
<tsuyoshi> if you exit it should just kill the remaining threads.. but then the documentation doesn't say one way or the other
<EliasAmaral> but if there are running threads, the termination of _ doesn't actually mean an "exit"..
<tsuyoshi> it doesn't?
<EliasAmaral> i think if the main thread dies, another thread becomes the "main thread".. or, better, there are no main thread
<EliasAmaral> o.o
<EliasAmaral> btw, the interactive interpreter outputs the ha! and hu!
<EliasAmaral> even with the version without flush
<EliasAmaral> http://pastebin.com/d7e5d9923 works, http://pastebin.com/m3b7da9a not, i am thinking in workarounds that don't use Thread.join
beterraba has joined #ocaml
<beterraba> hello. Does someone knows about surreal numbers or where can i find some implementation for it in SML/NJ , ML or oCAML?
seafoodX has joined #ocaml
threeve has left #ocaml []
Demitar has quit [Read error: 110 (Connection timed out)]
<EliasAmaral> Thread 2 killed on uncaught exception Invalid_argument("Thread.kill: not implemented"), running as bytecode with linux, any workaround? seems undocumented
<EliasAmaral> I can't compile to native code because it says "gcc: /usr/lib/ocaml/3.09.2/unix.o: Arquivo ou diretório inexistente" (file or directory doesn't exists)
<EliasAmaral> when I compile with ocamlopt -I +threads -o p-life unix.cmx threads.cmxa event.cmx p-life.ml
mordaunt has quit [Read error: 104 (Connection reset by peer)]
<EliasAmaral> Hmm, but which threads can be killed?
<EliasAmaral> Win32 threads only?
* EliasAmaral reading
<tsuyoshi> that seems to indicate that posix threads on linux can be killed
<tsuyoshi> I don't know... threads on unix have always seemed to have too many disadvantages to be worthwhile to me, versus processes
<tsuyoshi> actually I shouldn't say that, I used to be enthusiastic about threads
<EliasAmaral> but Thread.create creates "Lightweight threads for Posix 1003.1c and Win32.", as the reference says
<tsuyoshi> but now I think they're too much trouble.. you run into all sorts of problems like this
<tsuyoshi> EliasAmaral: what kind of system are you on?
<EliasAmaral> tsuyoshi, i am relying on _one_ "global" variable being shared to the whole body of threads, and i am willing do use mutexes to control it
<EliasAmaral> well, it's a group of parallels simulations
<EliasAmaral> each one can kill a simulation (including itself), create a simulation, etc
<EliasAmaral> they share a hash table that stores all simulations
<EliasAmaral> tsuyoshi, i will just store a bool ref that is visible by both the killer and the killed thread
<EliasAmaral> do you think that this is a good solution?
<EliasAmaral> I could use Event.send, but this seems an overkill
<tsuyoshi> what does the bool store?
<EliasAmaral> "should the target thread stop itself?"
seafoodX has quit []
<tsuyoshi> oh
<tsuyoshi> that seems to be the recommended way to do it
<EliasAmaral> it could be "too imperative"
flux-_ has joined #ocaml
flux has quit [Read error: 110 (Connection timed out)]
[azoic] has quit ["Leaving."]
seafoodX has joined #ocaml
flux-_ is now known as flux
<tsuyoshi> hmm well stopping a thread is imperative no matter how you do it
Mr_Awesome has quit ["aunt jemima is the devil!"]
Mr_Awesome has joined #ocaml
jlouis_ has joined #ocaml
jlouis has quit [Connection timed out]
ramki has joined #ocaml
<flux> eliasamaral, this piece of program exits immediately: let _ = Thread.create (fun () -> Unix.sleep 10) ()
<flux> eliasamaral, so it leads me to believe that infact remaining threads are not waited
<EliasAmaral> i didn't knew that there would be a "main" thread
<EliasAmaral> in my head, once created another thread in the program, i have two threads with equal rights
<EliasAmaral> btw, if anyone wants to see what i was doing, http://189.12.150.145/~dark/e/p-life/p-life.ml , it's an "hello world" that creates two simulations of conway's game of life that has some events that generates the output
<EliasAmaral> http://189.12.150.145/~dark/e/p-life/Makefile is a makefile for it
<EliasAmaral> and, Thread.kill in the end proved itself unecessary, but just because I already kept track of which threads are "valid" elsewhere, but I considered it nice :(
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
jonathanv has quit [Read error: 104 (Connection reset by peer)]
jlouis_ has quit [Connection timed out]
<flux> I would never consider Thread.kill nice
<flux> btw, threads in ocaml don't give you concurrency
<flux> but I think with cothreads you will receive thread-like concurrency with processes..
kelaouch1 has quit [Client Quit]
kelaouchi has joined #ocaml
Demitar has joined #ocaml
<EliasAmaral> flux, hmm, but with cothreads i can share data between threads?
<EliasAmaral> if not i am considering using just fork() and having some message passing mechanism
<EliasAmaral> but, well, i am going to sleep now =) bye bye
replore has joined #ocaml
olegfink has quit [Read error: 104 (Connection reset by peer)]
replore has quit [Read error: 113 (No route to host)]
olegfink has joined #ocaml
seafoodX has quit []
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
pantsd has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
iratsu has joined #ocaml
Tetsuo has joined #ocaml
<hcarty> EliasAmaral: I think that is what cothreads is meant to provide, along with the ability to switch implementations without changing the source code
Hadaka has quit [kornbluth.freenode.net irc.freenode.net]
<tsuyoshi> trying to read the stm manual but the english is not very good.. little hard to understand
<tsuyoshi> general idea looks nice though
<tsuyoshi> like sql transactions
baruk has quit ["z"]
Naked has joined #ocaml
Naked is now known as Hadaka
jlouis has joined #ocaml
ramki has quit ["Leaving"]
jlouis_ has quit [Success]
[azoic] has joined #ocaml
seafoodX has joined #ocaml
[azoic] has quit ["Leaving."]
Mr_Awesome has joined #ocaml
schme` has joined #ocaml
pango has quit [Remote closed the connection]
seafoodX has quit []
piggybox has joined #ocaml
gunark has quit ["Konversation terminated!"]
seafoodX has joined #ocaml
pango has joined #ocaml
jonathanv has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
schme has quit [Connection timed out]
jonathanv has quit [Read error: 104 (Connection reset by peer)]
seafoodX has quit []
jonathanv has joined #ocaml
netx has quit ["Leaving"]
<noss> tsuyoshi: optimistic transactions, i wonder what happens if threads step on each other's toes too much.
Demitar has quit [Read error: 110 (Connection timed out)]
Cygaal has joined #ocaml
smimou has joined #ocaml
Cygaal has quit [Read error: 110 (Connection timed out)]
Cygaal has joined #ocaml
slipstream has joined #ocaml
slipstream-- has quit [Read error: 110 (Connection timed out)]
ita has joined #ocaml
<mbishop> noss: STM handles concurrent data access by killing one thread and letting the first one access first
<noss> rollback rather than killing, no?
<mbishop> probably, "reset" would be proper, I suppose
threeve has joined #ocaml
threeve has quit [Remote closed the connection]
psnively has joined #ocaml
hagman has joined #ocaml
delamon has joined #ocaml
Mr_Awesome has joined #ocaml
ygrek has joined #ocaml
crathman has joined #ocaml
hagman has quit ["Leaving..."]
kelaouchi has quit [Remote closed the connection]
hagman has joined #ocaml
ita has quit ["Hasta luego!"]
hagman has quit ["Leaving..."]
Mr_Awesome has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
piggybox has quit [Connection timed out]
Cygaal has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
Cygaal has joined #ocaml
jlouis_ has joined #ocaml
pantsd has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
jlouis has quit [Connection timed out]
beterraba has quit ["Ex-Chat"]
clog has joined #ocaml
<jonathanv> that's it, the marriage is off
<jonathanv> okay, it's stupid, but i'm going to think about it
<jonathanv> maybe if i just pretend ocaml's string implementation isn't even stupider than c++'s, things will be okay
<jonathanv> k going home
<jonathanv> (BAFFLED AND DISTRAUGHT)
baruk has joined #ocaml