Re: MinGW RPC and thread problem

Sylvain Le Gall <[email protected]> Wed, 23 Jul 2008 07:28:39 +0000 (UTC)
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
Hello,

On 23-07-2008, Gerd Stolpmann <[email protected]> wrote:
>
>> Issue 2:
>> The event system seems to fail if compiled with thread support. It
>> fails with:
>> Fatal error: exception Sys_error("Mutex.unlock: error code 120")
>> Raised at file "", line 0, characters 0-0
>> I have not digged into this yet. But if you think that this is a bug
>> (threads are supposed to be supported under Windows) then I can have a
>> look into this.
>
> The major problem is that there is no way to cancel a running
> Unix.select (you need that if a different thread changes the conditions
> you wait for). For Linux this is simple - just put a pipe into the
> selected fdset, and write something into the pipe when you want to
> interrupt Unix.select. Windows does not support to add anything other
> than sockets to selectable fdset's, and there are no socketpairs that
> behave like socket-ized pipes, so this solution does not work.
>
> Anyway, I've started tackling this problem. In the svn version
> (https://godirepo.camlcity.org/svn/lib-ocamlnet2/trunk/code/) you find a
> special data structure called "pollset" that abstracts Unix.select, in
> module Netsys_pollset. The module Netsys_pollset_win32 has a special
> Win32 implementation (allowing cancellation). There is a variant of
> unixqueues that can take advantage of pollsets:
> Unixqueue2.pollset_event_system.
>

Well, I have worked on implementing Unix.select on windows. In the patch
i submitted last week, you can use "pipe ()" with "select". However,
there is some problems concerning pipe in general in windows: there is
no blocking call to poll them. So this is an active poll.

If INRIA accept my patch, i think we can have Unix.select () working
with pipes in OCaml 3.11. 

Just my 0.02€

Regards,
Sylvain Le Gall


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel