From starred@tiscali.it Thu Oct 25 13:38:32 2001
Received: from mailrelay2.inwind.it (mailrelay2.inwind.it [212.141.54.102])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f9PBcVt14765
	for <prolog@swi.psy.uva.nl>; Thu, 25 Oct 2001 13:38:32 +0200 (MET DST)
Received: from tiscali.it (62.98.191.72) by mailrelay2.inwind.it (5.5.029)
        id 3BCE96880028546E; Thu, 25 Oct 2001 13:38:14 +0200
X-Mozilla-Status: 0801
Message-ID: <3BD7FA1D.5030406@tiscalinet.it>
Date: Thu, 25 Oct 2001 13:40:13 +0200
From: starred <starred@tiscalinet.it>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1
X-Accept-Language: en-us
MIME-Version: 1.0
To: starred <starred@tiscalinet.it>
CC: SWI Prolog Mailing List <prolog@swi.psy.uva.nl>
References: <3BD7F3CF.8010004@tiscalinet.it>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Subject: [SWIPL] noticed one thing: is it normal that different agents use the same streams under the same host?

I've noticed that different agents starting on the same host, use 
streams denoted by the same code, i don't know exactly how streams are 
used by Windows, in particular i don't know if a stream code is local to 
the thread that opened it (in this case it should not be a problem) or 
if it is globally recognized by Windows (in this case it would generate 
an error when two threads try to use the same stream..)

Another report about my problem: i had the same problem some times ago, 
the i changed the timer value (see prolog-code below) and it did function.
Now i made some changes in the coordinator (it is the agent that finds 
facilities for othr agents in the web) code, and now coordinator (and 
only it) gives me the trapped signal 11 (general protection fault) error...



starred wrote:

> This an error that very often occurs during execution of a communication 
> between some agents i've created
> 
>  Trapped signal 11 (general protection fault), aborting ...
>       [1] '$toplevel'
> % Abort: closed stream '$stream'(5158192)
> % Abort: closed stream '$stream'(5149938)
> % Abort: closed stream '$stream'(5148678)
> % Execution Aborted
> 
> The problem is that after compiling the files, SWI prolog gives me no 
> error or warning, and i cannot understand where the problem is.
> Notice that the error occurs very often, but not always...
> 
> I'm working on an agent based environment, so every agent is both a 
> server and a client.
> the serving job is done in this way:
> 
> 
> dispatch(_GUI) :-
>     new(@dispatch_timer,timer(0.3,message(@prolog,dispatch1))),
>     send(@dispatch_timer,start).
> 
> 
> dispatch1 :-
> 
> findall(ReadStream,agents:connection(_ClientId,_Host,ReadStream,_WriteStream),Clients), 
> 
>     listen_stream(Server),
>     wait_for_input([Server|Clients],ReadyList, 0.05),
>     (ReadyList \= [])
>     ->
>     format('ReadyList is: ~w~n',ReadyList),
>     process_listen_queue(ReadyList)
>     ;
> % write(waiting),nl,flush_output,
>     true.
> 
> 
> process_listen_queue([]).
> 
> 
> process_listen_queue([H|T]) :-
>     handle_incoming(H),
>     format('ok~n~n'),
>     process_listen_queue(T).
> 
> 
> Bye
> 
> Armando Stellato
> 
> 



