<jason_>
Smerdyakov: Explain how an 'Event' works.
<jason_>
By comparing it to a Mutex.
<Smerdyakov>
They are not directly comparable. Your question is like "explain how functional programming works by comparing it to imperative programming."
<jason_>
Smerdyakov: Well, I didn't realize they were so different, which is why I was asking :)
<jason_>
Smerdyakov: Then, just explain an Event.
<Smerdyakov>
It's a first class synchronous event. You wait for something to happen, and, when it happens, it gives you a value.
<jason_>
Hm.
<jason_>
I don't understand.
<jason_>
You assign some statement to this 'event'?
<Smerdyakov>
Try to find the book "Concurrent Programming in ML."
<Smerdyakov>
I don't think there's any good tutorial on CML (what Event really is) online.
<jason_>
Alright.
<jason_>
Mutexes suck in my humble opinion.
<jason_>
So, I'm happy to find any alternatives.
<jason_>
Are they like critical sections, or something?
<Smerdyakov>
Basically, instead of a bunch of twits trying not to screw up while sharing some state, you have processes each with private state, communicating over channels.
<jason_>
Ah.
<Smerdyakov>
Now, what I said so far is just message passing, the traditional arch-nemesis of shared memory.
<jason_>
So, how does it deal with like, duplicating a file-descriptor or something?
<Smerdyakov>
What makes it neat is the mobility of channels.
<Smerdyakov>
And the ability to build your own first-class events using combinators.
<jason_>
Hm.. I really need to read a lot more about this to understand what you're saying.
efficxpert has joined #ocaml
mrsolo has joined #ocaml
skylan_ is now known as skylan
mrsolo has quit [Read error: 104 (Connection reset by peer)]
mrsolo has joined #ocaml
yauz has quit [Read error: 104 (Connection reset by peer)]
efficxpert has quit ["Leaving"]
<jason_>
Hm.
<jason_>
This is weird.
<jason_>
It works fine for a while, then suddenly the strings end up having a bunch of garbage in them.
<jason_>
Could it be a heap overflow or something?
<mellum>
not really
<mellum>
are you using C or unsafe functions?
<jason_>
The Unix module.
<jason_>
Reading from a socket.
<jason_>
I basically have a expression that takes a string->unit and passes into it every string read from the client to the server.
<jason_>
So, the client connects to the socket, it reads each line from it, and passes it into this given expression.
<jason_>
mellum: I thought it may have been the fact that the program is multi-threaded.
<mellum>
Hm, that might be. I tend to avoid multi-threading like the plague
<jason_>
Yeah, I kind of need it for this.
<jason_>
I need to actively read from the client, and the server at the same time.
<jason_>
I'd expect for there to be an exception or something if it was a threading error.
<jason_>
I tried using a Mutex, no dice.
<jason_>
Hm.. This is proving to be a very difficult to track down error.
<jason_>
Like, everything works fine for a while, then suddenly: ?G@??@?G
<jason_>
A bunch of crap like that is appened to the end of the strings I'm printing out.
<jason_>
Like, ocaml suddenly stops padding the strings.
<jason_>
Yeah.. It's definitely a threading problem.
mattam_ has joined #ocaml
jason_ has quit [Remote closed the connection]
mattam has quit [Read error: 110 (Connection timed out)]
Xolution has quit [Read error: 54 (Connection reset by peer)]
smimou has joined #ocaml
poulpx has joined #ocaml
<grirgz>
lol
<poulpx>
amateur
poulpx has left #ocaml []
<mflux>
I wonder if he's usind read but not truncating the strings according to the number of bytes
slashvar[lri] has joined #ocaml
<slashvar[lri]>
Hi there
<grirgz>
plop
mrsolo has quit [Read error: 104 (Connection reset by peer)]
mrsolo has joined #ocaml
ita has joined #ocaml
<ita>
meow
<grirgz>
ouaf!
bk_ has joined #ocaml
leolio has joined #ocaml
vezenchio has joined #ocaml
leolio has quit ["Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC."]
Submarine has joined #ocaml
grirgz has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
vezenchio has quit ["I thought what I'd do was, I'd pretend I was one of those deaf-mutes ^_^"]
vezenchio has joined #ocaml
ita is now known as ita|away[home]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
leolio has joined #ocaml
skylan has joined #ocaml
vezenchio has quit ["I thought what I'd do was, I'd pretend I was one of those deaf-mutes ^_^"]
vezenchio has joined #ocaml
gl has joined #ocaml
vezenchio has quit ["I thought what I'd do was, I'd pretend I was one of those deaf-mutes ^_^"]
maihem has joined #ocaml
maihem has quit [niven.freenode.net irc.freenode.net]
vezenchio has joined #ocaml
maihem has joined #ocaml
mattam_ is now known as mattam
TheDracle has joined #ocaml
vezenchio has quit ["I thought what I'd do was, I'd pretend I was one of those deaf-mutes ^_^"]
vezenchio has joined #ocaml
Hadaka has quit ["leaving"]
Submarine has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4.1/20031114]"]
Naked has joined #ocaml
CosmicRay has joined #ocaml
Naked is now known as Hadaka
pnou has quit ["brb"]
pnou has joined #ocaml
gl has quit ["leaving"]
maihem is now known as {0xDEADBEEF}
{0xDEADBEEF} is now known as maihem
Hadaka_ has joined #ocaml
Hadaka_ has quit [Read error: 104 (Connection reset by peer)]
Hadaka_ has joined #ocaml
zigong__ has joined #ocaml
whee has joined #ocaml
CosmicRay has quit ["Client exiting"]
leolio has quit [Remote closed the connection]
jay_23 has joined #ocaml
jay_23 has left #ocaml []
maihem has quit ["Read error: 54 (Connection reset by chocolate)"]