Cook Computing

Channel9 Video on Singularity

December 5, 2005 Written by Charles Cook

Last night I watched the second Channel9 video on Singularity. Some notes I made while watching:

  • Dependability is the main goal - not performance.
  • Managed code right down to the lowest level of the OS stack.
  • Device drivers in managed code.
  • 12 people working fulltime - about 20 other contributors.
  • OS not JIT'ed - obvious bootstrap problem.
  • 2% of files assembly code, 3% C++, 18% unsafe C#.
  • 18% of files contain unsafe C# - but only parts of each file - better than mix of C# and C++ because no interop problems and easier to encapsulate unsafe code.
  • Plans for verification of more unsafe code in future - for example array bounds checking.
  • Apps must be 100% verified managed code.
  • Status - kernel up and running - file system - network stack - web server (based on Cassini).
  • Running modified SPECWeb tests - latency better than Windows - throughput worse due to poor performance of current filesystem.
  • Processes are "closed" - cannot load code dynamically or do codegen - allows better program analysis - for example convert virtual calls into static calls.
  • Processess communicate with other processes via "channels" - no shared memory so that process state is completely independent - if one process fails does not require other to be shut down.
  • Channels are defined via contract - format of message and legal sequence of messages (state machine so buffers required for a channel can be determined at compile time).
  • Implementation of channels is opaque to processes and once message has been sent the sending process loses ownership and cannot modify message (guaranteed by compiler).
  • A channel is not a process - has own memory but not code.
  • Why have threads in process and associated synchronization problems - support multiple async channels - also better code structure when using threads as opposed to event handling.
  • Other threading mechanisms being explored - for example "transactional memory" - traditional transactional guarantees when accessing data structure in memory (atomic, rollbacks, etc).

Towards the end of the video they drew an outline of the Singularity architecture on a whiteboard. It looked something like this: Singularity architecture The diagram is taken from An Overview of the Singularity Project. This document covers the topics in the video in much more detail and is well worth reading for a glimpse of the type of OS we might be using in the future.