lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: system() vs. fork()+exec*()


From: Graham Douglas
Subject: Re: system() vs. fork()+exec*()
Date: Mon, 16 Jul 2001 23:22:13 +0100

On Mon Jul 16, 2001  Razl Nzqez de Arenas Coronado wrote:

> Under Unix it would be better and faster to use fork()+exec*().
> This way the prg2lout could be in the same binary as Lout, and
> execution of filters would be much faster and less memory hungry,
> since no shell is invoked.

Hi Razl

Yes, this is along the lines I was thinking of (but for
Windows). Putting aside the various system dependencies
for a moment....[I'm sure we could find the appropriate
system-specific functions]. Suppose that one wanted to have
a new primitive called, say, @Script{...} which allowed
embedded scripting language commands [or other program
commands] to be embedded, I would like
to know how you'd actually communicate the output to
Lout?

===================================
((Also, and I guess this is seriously complex, how
would you add the new @Script{} primitive to Lout
so that it's parsing mechanism would recognise it?
[Install in a symbol table somewhere, of course, but I'm
sure there are hugely complex issues involved?]))
===================================

It is obviously done at present with the @Filter
command but that requires file I/O (creating temporary
files) plus the system(...) call overhead.
If, for some reason [which I can't think of now...],
you wanted to, say, run a lot of complex scripts but
preferred to create the results (Lout source) *in memory*
-- for speed -- how could you tell Lout to:

"Stop reading the current source file and
please temporarily switch to reading the memory
block pointed to by (pointer). Once you've done that
please carry on in the source file where you left off."
[I'm sure there are issues here I have no concept of].

I'm just posing the question -- I have no idea
of the answer. I know that Lout is fast and
that the existing @Filter works well but the idea of
not having to continually call the shell because
Lout had the scripting language "built in?" might be
an interesting avenue to explore. Maybe not?

Anyway, best wishes to all

Cheers

Graham









reply via email to

[Prev in Thread] Current Thread [Next in Thread]