[Gllug] pipes and C++

James Hawtin oolon at ankh.org
Mon Sep 13 11:38:33 UTC 2010


On Mon, Sep 13, 2010 at 09:39:09AM +0100, Adrian McMenamin wrote:
> Yes, I worked this out last night - process B was waiting around in the
> XML parser: it throws an exception when A delivers its second batch of
> output - querying why it has more XML after it has already received a
> closing tag.

I was going to say the problem with XML is many of the programs that read or
generate it do not start "working" until they have received a complete XML
file, rather than a record at time. The parser here is clearly waiting for
the end of the XML and the file to be closed. As already suggested tie A|B
together in a pipe and just make C remain resident. If you are having
problems with the parser in C save the output of A&B to a file, then use the
pipe as a way to kick C into re-reading the config file. Even just re-read
on a timer for example the following would work.

A | B > new.out
mv new.out output

C always reads the "output", this way it should never read a half complete
file.

I understand this is not "crash" resistant as the output of new.out may not
be synced to disk before it is moved. However in this case that should not
be a major problem, as you can get A|B to complete first before running C on
renevokation. 

James
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list