Tokyo July, 2005 Introduction to ACE Bogdan Jeram ([email protected]) European Southern Observatory.

10
Tokyo July, 2005 Introduction Introduction to to ACE ACE Bogdan Jeram ([email protected]) European Southern Observatory

Transcript of Tokyo July, 2005 Introduction to ACE Bogdan Jeram ([email protected]) European Southern Observatory.

Page 1: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

Tokyo July, 2005

IntroductionIntroductiontoto

ACEACE

Bogdan Jeram([email protected])

European Southern Observatory

Page 2: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

2

ALMA Project

Tokyo, July 2005 ALMA Common Software course

ACE Hardware

Page 3: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

3

ALMA Project

Tokyo, July 2005 ALMA Common Software course

What is ACE

• Adaptive Communication Environment• freely available, open-source object-oriented (OO)

framework that implements many core patterns for concurrent communication software

• OS independent interface to OS services• Portable code• very lot of very useful functionality• TAO CORBA implementation based on ACE

Page 4: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

4

ALMA Project

Tokyo, July 2005 ALMA Common Software course

ACS threads

• based on ACE threads

• integrated in ACS

• thread Manager

• See specific presentation and documentation

Page 5: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

5

ALMA Project

Tokyo, July 2005 ALMA Common Software course

Protection/Locks Primitives

• ACE_Mutex– acquire()– release()– try_acquire()

• Several types of mutex:– ACE_Thread_Mutex– ACE_Recursive_Thread_Mutex– ACE_RW_Mutex (acquire_read, release_read)

– ACE_RW_Thread_Mutex

Page 6: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

6

ALMA Project

Tokyo, July 2005 ALMA Common Software course

Synchronization

• implementation of Dijekstra’s “counting semaphores”

• ACE_Semaphores:– acquire()– release()– try_acquire()

Page 7: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

7

ALMA Project

Tokyo, July 2005 ALMA Common Software course

ACE guard class

• improve application robustness

• constructor -> mutex acquired

• destructor -> mutex released

• ACE_Guard:– acquire()– release()– try_acquire()

Page 8: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

8

ALMA Project

Tokyo, July 2005 ALMA Common Software course

ACE_Guard example

ACE_Recursive_Thread_Mutex m;

void write()

{ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m);

// critical section

// explicitly: guard.release();

}

Page 9: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

9

ALMA Project

Tokyo, July 2005 ALMA Common Software course

ACE strings

• ACE_CString:– Memory managment– Concatenation (using +)– Convention to C style string– …

• http://www.dre.vanderbilt.edu/Doxygen/Current/html/ace/classACE__String__Base.html

Page 10: Tokyo July, 2005 Introduction to ACE Bogdan Jeram (bjeram@eso.org) European Southern Observatory.

10

ALMA Project

Tokyo, July 2005 ALMA Common Software course

References

• ACE home page: http://www.cs.wustl.edu/~schmidt/ACE.html

• Several books