Version française
Home     About     Download     Resources     Contact us    
Browse thread
async networking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] Re: async networking
> The multiple serving threads could actually make for an simple api,
> actually. A simple function to add a receive callback for a port would
> be all you'd need. You could even pass in a buffer to that callback that
> a person could respond directly to for socket send, since the same
> thread is handling the send requests as well.

I haven't checked the systhreads implementation (as I don't use it),
but if it's anything similar to the vmthreads implementation, it is
not very high performance.

For example: to reschedule a thread, vmthreads a) uses select (not
sure if this is a problem), and b) does a linear search for a runnable
thread (I can't remember if it stops early, I'd have to have another
check).

The point is, in this case, you'd need to rewrite it to use thread
queues for the various states to get something closer to an O(1)
scheduler.

Jonathan