Re: EventLoop shutdown procedure..

2006-08-23 Thread Henrik Nordstrom
On Mon, 2006-08-21 at 22:17 +1000, Robert Collins wrote:
 I'd like to make the shutdown procedure async as well - allowing things
 like swap log writing to use calls elsewhere in the codebase that are
 async - like the disk engines.

Makes sense.

 Heres my proposed api:
  - on EventLoop you can call addShutdownEvent(callback, callbackdata);
  - this builds up a vector of pending shutdown callbacks.
  - when the event loop detects its time to stop - i.e. because its had
 stop() called, or because its gone idle, it invokes the last registered
 callback. This has a signature like 'void SHUTDOWNEVENT(callback,
 callbackdata);'. The event loop will invoke it with the loop as the
 callback data - so when that routine completes, the loop will move onto
 the next shutdown event and so on.
  - When the last shutdown event returns, the loop will return to the
 caller of run().

Sounds reasonable. My first thinking was why not do this with a
broadcast message bus asking the subsystems to prepare for shutdown, but
this simple scheme is easier.
 
 This has a couple of ramifications:
  - we'll need to teach various layers like comms that there core can be
 shutdown *while* the event loop is still running - but this is
 conceptually quite easy IMO.

Yes.

  - we'll have a mismatch between some parts of reconfigure and this
 approach, for a but - but thats reasonably easy to deal with in the
 short term. Long term, if reconfigure becomes async itself it will be
 non problematic.

Agreed. Should not be a problem in itself. But getting the clean store
index management async while still allowing the comm loop to run will be
a bit of a challenge...

Regards
Henrik



Re: EventLoop shutdown procedure..

2006-08-22 Thread Adrian Chadd
On Mon, Aug 21, 2006, Robert Collins wrote:
 I'd like to make the shutdown procedure async as well - allowing things
 like swap log writing to use calls elsewhere in the codebase that are
 async - like the disk engines.

Can this wait until squid-3 is released and stable?
Pretty please? :)





Adrian



Re: EventLoop shutdown procedure..

2006-08-22 Thread Robert Collins
On Tue, 2006-08-22 at 17:10 +0800, Adrian Chadd wrote:
 On Mon, Aug 21, 2006, Robert Collins wrote:
  I'd like to make the shutdown procedure async as well - allowing things
  like swap log writing to use calls elsewhere in the codebase that are
  async - like the disk engines.
 
 Can this wait until squid-3 is released and stable?
 Pretty please? :)

If that takes less than another aeon, sure thing.

Having all the core doing bugfixes should make that happen promptly
though, so no fear.

-Rob
-- 
GPG key available at: http://www.robertcollins.net/keys.txt.


signature.asc
Description: This is a digitally signed message part