I have been using lyx for the last 6 months and I quite happy with it.
However, I have the problem that when lyx (or convert from ImageMagick)
opens too many images at a time, my machine (600Mhz x86 processor)
grinds to a halt. No interactive operations including moving a mouse are
possible.
The reason lyx is opening so many images at a time is because I have a
large document and I want all the images to be open when I start viewing
a document. So I scroll through the whole document one page at a time
and then go for a coffee until convert has done its job. Ideally, there
would be an option to open all images in the background after lyx opens
a document. Of course, either way, I would have to go for a coffee if
all the convert operations run in parallel.
So I have written a small script "sequential" that simply runs one image
conversion at a time. All you have to do is to replace "convert" with
"sequential convert" in your converters preferences. Here is the script.
I have tested it and it works really well at keeping system load down.
Now, I just wish that there was the option to open all images as
mentioned above.
Thanks again for a good job.
Ashvin Goel
-------------------------------------------------------------------------------
#!/bin/bash
#
# This program will run one "command" per user at a time on a machine.
# The check is based on name of the command.
# It assumes that you have /proc/pid available to test whether a process is
# still running.
#
if [ $# -lt 1 ]; then
echo "Usage: sequential command [command-args]" 1>&2;
exit 1;
fi
CMD=$1;
USER=${USER:-$(id -un)};
FILE=/tmp/${CMD}_${USER};
trap "rm -f $FILE" 1 2 15;
if [ -f "$FILE" ]; then
# First check that the process exists
PID=$(cat $FILE);
if [ ! -d "/proc/$PID" ]; then
rm $FILE;
else while [ -f "$FILE" ]; do
sleep 1;
done
fi
fi
echo $$ > $FILE;
eval "$@"
rm -f $FILE;
-------------------------------------------------------------------------------
> * From: Max Bian
> * Subject: Re: lyx 1.20pre5 bugs and misses
> * Date: Fri, 10 May 2002 08:24:00 -0700
>
> The original suggestion was to put a cap on the number of processes.
> For example, run only 4 conversion process at the same time.
>
> Or saved the converted images with the original figures so there is no
> need to convert everytime the document is opened.
>
> Max
>
> Angus Leeming wrote:
>
> >
> > Well, we use lazy conversion, so only the graphics images that you
try and
> > display will be passed to the converter. Clearly, if you convert
them all at
> > the same time, then you're going to up your CPU usage, but this is
most
> > definitely a function of the converting tool you use.
> >
> > I can't see that there's much we can do about this.
> >
> > Angus
> >