Subject: Re: Slow startup with CVS 2.3.0

From: Bob Woodside <[email-masked]>
Date: Tue, 02 Mar 1999 12:00:26 -0500

Tim Phipps <[email-masked]> wrote:
>  If it was a delay of 42 seconds and the windows weren't
>  bordered I'd guess at the new start up algorithm....

	Eh? Obviously I've missed something, um, interesting in the last couple
of days. Could you elaborate a littl on this 42-second startup
algorithm?

- Bob
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Tim Phipps <[email-masked]>
Date: Thu, 04 Mar 1999 12:33:05 +0000

> of days. Could you elaborate a littl on this 42-second startup

There's a bug report that  [fvwm -cmd "read system.rc" -cmd "read
user.rc"] would ignore the decorations specified in user.rc until a
Recapture.  The reason for this behaviour was that the initial capture
and styling of windows happened after the first Read finished.  It was
possible to hang fvwm at start-up with [fvwm -cmd "Echo hello"] as well
as there was no Read.  The only reason that Fvwm{M4,CPP} ever worked was
that they created a file and sent a Read command to fvwm.

What I did was to take the call to StartupStuff() out of the Read
command and put it in the main event loop.  It now gets called as soon
as all commands started by the command line have finished. To get a
general solution I implemented a monitor of all modules started by the
command line that counts all the start-up modules as they are started
and as they finish.  Once there are no modules running StartupStuff() is
called and counting ceases.  What you can now do is to have FvwmCpp send
lots of reads and even start other modules and fvwm will sit there
reading in the config commands until all the modules it has started have
quit and then it will do the initial capture (and get the decorations
right) and run InitFunction.

The problem with this is that it's more likely that something will
wedge.  You must not cause a module to start that requires a top level
window (e.g. FvwmBanner) since fvwm will not reparent the window until
after StartpStuff().  Any module trying to create a top level window
will hang until fvwm reparents it, which it won't until all the start-up
modules are finished.

To prevent the above deadlock I put a time-out on the select() in the
main event loop.  When StartupStuff() is called the time-out is
disabled. If the select() times out StartupStuff() is called.  I set the
time-out to be large so that it would annoy the user into fixing the
problem (with their command line args).

I don't think this is the cause of Dans slow start-up as he reports the
windows are captured before the delay. It's strange that the delay is
roughly the same as the time-out so it may be that there's a bug.  If a
time-out happens there will be an error message in the log file.

Hope this helps,
Tim.

---

From: [email-masked] (Paul D. Smith)
Date: 04 Mar 1999 12:26:39 -0500

tp> The problem with this is that it's more likely that something will
  tp> wedge.  You must not cause a module to start that requires a top
  tp> level window (e.g. FvwmBanner) since fvwm will not reparent the
  tp> window until after StartpStuff().  Any module trying to create a
  tp> top level window will hang until fvwm reparents it, which it won't
  tp> until all the start-up modules are finished.

  tp> To prevent the above deadlock I put a time-out on the select() in
  tp> the main event loop.  When StartupStuff() is called the time-out
  tp> is disabled. If the select() times out StartupStuff() is called.
  tp> I set the time-out to be large so that it would annoy the user
  tp> into fixing the problem (with their command line args).

Wow.  Tim, can you add a FAQ about this?  I think it warrants it;
something like:

 Q. My fvwm startup now takes a lot longer!  What's up?

 A. ...???...

Also a note in the NEWS file (if there isn't already) is probably a good
idea.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]