Writing a Subsystem Manager Device Server using YAT some feedback about the design and implementation of a system supervisor involving hundreds of heterogeneous.

Slides:



Advertisements
Similar presentations
purpose Search : automation methods for device driver development in IP-based embedded systems in order to achieve high reliability, productivity, reusability.
Advertisements

Operating System.
Windows XP Kernel Architecture Mike Karlsven James Farrer Jason Smith.
Web Server Implementation On DE2 Final Presentation
Chorus Vs Unix Operating Systems Overview Introduction Design Principles Programmer Interface User Interface Process Management Memory Management File.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
The ADTB Library N.Leclercq – J.Malik – INF/ICA. ADTB – What is this? C++ toolbox for TANGO device impl. dependencies: Tango.lib & omnithread.lib dependencies:
An Energy Consumption Framework for Distributed Java-Based Systems Chiyoung Seo Software Architecture Research Group University of Southern California.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Chapter 13 Embedded Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
I/O Systems I/O Hardware Application I/O Interface
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
1 EPICS Bus Errors & Power PC u VME Bus Error can generate a Machine Check Exception (MCE) u The WRS mv2700 BSP doesn’t have code to do this u Write cycles.
ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
5-Oct-051 Tango collaboration status ICALEPCS 2005 Geneva (October 2005)
Developing Applications with the CSI Framework A General Guide.
How to write a MSGQ Transport (MQT) Overview Nov 29, 2005 Todd Mullanix.
Threads-Process Interaction. CONTENTS  Threads  Process interaction.
Threads A thread is an alternative model of program execution
02/02/20001/14 Managing Commands & Processes through CORBA CHEP 2000 PaduaPadua Sending Commands and Managing Processes across the BaBar OPR Unix Farm.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Development of the TANGO Alarm System Lorenzo Pivetta – ICALEPCS 2005 Sincrotrone Trieste - ELETTRA.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
1 Threads in Java Jingdi Wang. 2 Introduction A thread is a single sequence of execution within a program Multithreading involves multiple threads of.
4. Operations and Performance M. Lonza, D. Bulfone, V. Forchi’, G. Gaio, L. Pivetta, Sincrotrone Trieste, Trieste, Italy A Fast Orbit Feedback for the.
LonWorks Introduction Hwayoung Chae.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Computer System Structures
Threads in Java Jaanus Pöial, PhD Tallinn, Estonia.
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Introduction to threads
REAL-TIME OPERATING SYSTEMS
Module 12: I/O Systems I/O hardware Application I/O Interface
Current Generation Hypervisor Type 1 Type 2.
Operating Systems : Overview
CS 6560: Operating Systems Design
How to Integrate LabVIEW Applications into a Tango Control System
Advanced OS Concepts (For OCR)
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Async or Parallel? No they aren’t the same thing!
Operating Systems : Overview
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Operating Systems : Overview
Lecture Topics: 11/1 General Operating System Concepts Processes
COMPUTER PERIPHERALS AND INTERFACES
Threads Chapter 4.
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems : Overview
LO2 – Understand Computer Software
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Writing a Subsystem Manager Device Server using YAT some feedback about the design and implementation of a system supervisor involving hundreds of heterogeneous devices… N.Leclercq - SOLEIL- 21th Tango Meeting – 05/2009

Writing a Subsystem Manager Device Server using YAT some feedback about the design and implementation of a system supervisor involving hundreds of heterogeneous devices… N.Leclercq - SOLEIL- 21th Tango Meeting – 05/2009

Writing a Subsystem Manager Device Server using YAT just want to let you know that there’s “something” on tango-ds that could be useful in some of your projects… N.Leclercq - SOLEIL- 21th Tango Meeting – 05/2009

Use Case: FOFB Manager need an example to illustrate this talk! a typical YAT use case

Use Case: FOFB Manager 240 Tango devices involved  48 X-corrector power supplies  48 Z-corrector power supplies  120 BPMs (Libera) 48 “associated with x-corrector” bpms 48 “associated with z-corrector” bpms 24 “no corrector” bpms  17 timing boards  2 fiber network sniffers (Libera intercon.)  1 DCCT (stored current)  3 misc. (SOLEIL internal cooking)

Use Case: FOFB Manager a device in order to…  configure,  monitor,  control the FOFB system … … as a whole!  one button FOFB start/stop

Use Case: Constraints critical application for machine operation, so… … should be reliable, efficient, scalable and... maintainable!

Use Case: Design adopt the simplest possible design with a clear separation of concern between subsystems management concentrate supervision logic into a dedicated entity

Use Case: Design use “active objects”  split global activity into separate “tasks” running in parallel and exchanging data via messages one orchestrating the global activity and running the core logic  actual manager - knows how FOFB system works! one per subsystem to manage/ctrl  knows how its associated FOFB subsystem works  hi-level subsystem interface for the manager  get (and pre-compute) data …  … then forward it to the manager (or report errors)

Use Case: Impl. a task = a thread + a msgQ task activity triggered by messages  passively waits for msgs no activity means no CPU consumption  external vs internal notifications “self generated” msgs PERIODIC: best effort on-time delivery TMO: “no activity” notification

Use Case: Impl. handle one message at a time  a task can’t be interrupted while processing a msg msgs serialization limitation? might be in very specific contexts  FIFO msgQ with msg priority is supported  support the lo/hi watermark paradigm provides a way to detect system overload make the message a generic container  msg = type/ID + optional data  can post “any” data to a task

The Use Case: Impl. might be a recurrent need so…  externalize these sw tools into a library make this lib a general purpose C++ toolbox  offer more than the simple task impl. so… the we are about to write yet another toolbox? yes, so… let’s call it YAT!

YAT: Overview C++ toolbox offering misc. services  threading: task and sync. objects  memory management: [circular] buffer<>, …  network com.: client & server sockets  misc: timer, “a la Tango” exception, bits-stream, … Supported platforms  Windows, Linux & MacOS X Does it have some Tango dependency?  no dependencies  but… we have Yat4Tango YAT specialization for Tango yat::Task vs yat4tango::DeviceTask

YAT: Overview C++ toolbox offering misc. impl. tools  threading: thread, task and sync. objects  memory management: [circular] buffer<>, …  network com.: client & server sockets  misc: timer, “a la Tango” exception, bits-stream, … Supported platforms  Windows, Linux & MacOS X Any dependency?  no – can be used in “any” project – not only devices  native impl. - use target platform API

YAT: Overview What is Yat4Tango?  a YAT specialization for Tango  yat4tango::DeviceTask  yat4tango::ThreadSafeDeviceProxy

YAT: Using the DeviceTask

virtual void process_message (yat::Message& msg) = 0; virtual void process_message (yat::Message& msg);

YAT: Using the DeviceTask virtual void MyTask::process_message (yat::Message& msg) { switch ( msg.type() ) { case yat::TASK_INIT: break; case yat::TASK_EXIT: break; case yat::TASK_PERIODIC: break; case yat::TASK_TIMEOUT: break; case MY_DATA_MSG: break; }

YAT: Using the DeviceTask public: virtual void go (size_t tmo); DeviceTask::go  synchronous impl.  waits up to tmo ms for this task to start  msg. id: yat::TASK_INIT

YAT: Using the DeviceTask public: virtual void exit (); DeviceTask::exit  synchronous impl.  asks the task to quit, joins with the underlying thread then returns  msg. id: yat::TASK_EXIT

YAT: Using the DeviceTask public: virtual void post (yat::Message* msg, size_t tmo); DeviceTask::post  posts the specified msg to the task – i.e. inserts it into its msgQ according to msg priority - then returns  in case the msgQ is full - i.e. hi-watermark reached - waits up to tmo ms for the msgQ to reach its low watermark - throws a Tango::DevFailed in case of failure  system overload, too slow processing …

YAT: Using the DeviceTask public: virtual void wait_msg_handled (yat::Message* msg, size_t tmo); DeviceTask::wait_msg_handled  same as post but also waits up to tmo ms for the msg to be handled  synchronous msg. handling might be required for some specific msgs  what’s about using a MyTask public method instead?  you can do that but… no race condition with wait_msg_handled – msg processing is serialized

YAT: Using the DeviceTask #define MY_DATA_MSG yat::FIRST_USER_MSG + 1 MyTask * t = …; MyDataStruct * d = …; yat::Message * m = new yat::Message(MY_DATA_MSG); m->attach_data(d); t->post(m, 1000);

YAT: Using the DeviceTask virtual void MyTask::process_message (yat::Message& msg) { switch ( msg.type() ) { case MY_DATA_MSG: this->process_data ( msg.get_data() ); or this->process_data ( msg.detach_data() ); break; }

(back to) Use Case: Impl. we said… one task orchestrating the global activity and running the core logic  actual manager - knows how FOFB system works! one per subsystem to manage/ctrl  knows how its associated FOFB subsystem works  hi-level subsystem interface for the manager  get (and pre-compute) data …  … then forward it to the manager (or report errors)

Conclusion  simple & efficient design/impl  we obtain very good results in terms of performances, stability and maintainability  if you want to give YAT a try…  sourceforge/tango-ds/libraries  contributions are welcome!