Browse thread
Ocaml debugger under Windows
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Benedikt Grundmann <benedikt@c...> |
| Subject: | Re: [Caml-list] Ocaml debugger under Windows |
Use Shawn Wagner's MsgQueue module to communicate between both threads in a select friendly way. http://raevnos.pennmush.org/code/ethread/doc/MsgQueue.html Cheers, Bene 2008/2/5, Dmitry Bely <dmitry.bely@gmail.com>: > On Feb 5, 2008 12:54 PM, Alain Frisch <alain@frisch.fr> wrote: > > Dmitry Bely wrote: > > > The topic has a long history [1], but since then nothing has actually > > > changed. It's easy to understand: INRIA people are busy and there are > > > probably quite few Ocaml users in the Windows land to worry about. So I > > > decided to do something myself :) (as it was with mingw port several > > > years ago). > > >... > > > If it's interesting for anyone I can publish a patch against Ocaml 3.10.1 > > > > Yes, that's definitely interesting for us! > > > > Is there any hope to build the server with the mingw or msvc port? > > As soon as the following function is rewritten: > > debugger/input_handling.ml > > (* Handle active files until `continue_main_loop' is false. *) > let main_loop () = > let old_state = !continue_main_loop in > try > continue_main_loop := true; > while !continue_main_loop do > try > let (input, _, _) = > select (List.map fst !active_files) [] [] (-1.) > in > List.iter > (function fd -> > let (funct, iochan) = (List.assoc fd !active_files) in > funct iochan) > input > with > Unix_error (EINTR, _, _) -> () > done; > continue_main_loop := old_state > with > x -> > continue_main_loop := old_state; > raise x > > here Unix.select() waits for both network and user input events. We > could split this into 2 threads, but how to interrupt network select() > when we going to exit? Well, we could use some small timeout value for > select() (say 500ms) and restart it the loop when !continue_main_loop > is set, but this looks not very elegant... Or it's OK? > > The point is not to modify win32unix library or write Win32-specific C > functions for ocamldebug. I believe it's necessary to be ever accepted > by INRIA. > > > - Dmitry Bely > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Calvin: I try to make everyone's day a little more surreal. (From Calvin & Hobbes)