Version française
Home     About     Download     Resources     Contact us    
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
Hi,

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.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr