Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] printable digest strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Wserver: Values of global variables lost

On Sun, May 06, 2001 at 08:56:48PM +0200, Mattias Waldau wrote:

> I am trying to use wserver, and create a simple ocaml-based webserver.
> I am using it locally, and I assumed that the global variables in my ocaml 
> would be kept during the interaction with the user.
> However, in the following program sofar is always ref "".

It is because a new process is launched at every request. Wserver uses
the Unix.fork function which creates a separated process, the global
variables are therefore not shared.

It would have worked if Wserver had used the threads but it it not
implemented like that.

To unsubscribe, mail  Archives: