Clocks Adam T. Sampson School of Computing, University of Kent - - PowerPoint PPT Presentation

clocks
SMART_READER_LITE
LIVE PREVIEW

Clocks Adam T. Sampson School of Computing, University of Kent - - PowerPoint PPT Presentation

Clocks Adam T. Sampson School of Computing, University of Kent Neil C. C. Brown School of Computing, University of Kent Motivation My day job Big concurrent distributed simulations Lots of agents Discrete time steps Implemented


slide-1
SLIDE 1

Clocks

Adam T. Sampson

School of Computing, University of Kent

Neil C. C. Brown

School of Computing, University of Kent

slide-2
SLIDE 2

Motivation

slide-3
SLIDE 3

My day job

  • Big concurrent distributed simulations
  • Lots of agents
  • Discrete time steps

– Implemented using a barrier – Each step divided into several phases

slide-4
SLIDE 4

That's an awfully nice wheel

  • Event-based simulation is very similar
  • Actions occur at particular times
  • Implement as priority queue of actions

– Sorted by the time at which the action should occur

slide-5
SLIDE 5

Barrier

  • Has:

– Enrollment count – Set of blocked processes

  • When count == size(set), schedule all in set
slide-6
SLIDE 6

Clock

  • Has:

– Enrollment count – Priority queue of blocked processes

  • When count == size(queue), schedule all the

processes that have the lowest time

slide-7
SLIDE 7

Agent Smith

WHILE alive ... query environment ... think ... write changes back to environment WHILE now < next.time SYNC bar

slide-8
SLIDE 8

Agent Orange

  • This runs faster – because it doesn't have to

wake up on timesteps where it's not doing anything (which is most of them)

WHILE alive ... query environment ... think ... write changes back to environment SYNC clock, next.time

slide-9
SLIDE 9

Some questions

  • What should the semantics for ALT be?
  • Is it worth having language bindings?

– This can just be implemented as a process...

slide-10
SLIDE 10

Any questions?

  • Clocks are implemented in CHP – go and play!