μC++

From HandWiki

μC++, also called uC++, is a programming language, an extension of C++ designed for concurrent programming. Among other features, it adds coroutines, tasks, and monitors, and extends existing language constructs to integrate with them.[1] Its compiler, named u++, operates as a source-to-source translator targeting C++.

μC++ is part of the μSystem project, at the University of Waterloo, Ontario, Canada, a large-scale project led by professor Peter Buhr with the goal to create a "highly-concurrent shared-memory programming system".[2]

It is used in the CS 343 course at the University of Waterloo.[3]

Every μC++ program should include the uC++.h header file before any other header, although this is not necessary for more recent versions. uC++ is now open source, available on GitHub.[4]

Keywords

The following keywords are implemented in uC++ to provide extended functionality on class implementations, exception handling capabilities, and scheduling:

  • _Accept - enables external scheduling within monitors. _Accept allows a caller permission to obtain mutual exclusion over a method within the monitor
  • _At - raises a non-local exception at the argument
  • _CatchResume - catches an exception but follows the rules of resumption of a caller
  • _Monitor - an extension of a C++ class that permits a class to also operate as a monitor
  • _Cormonitor - an extension of a C++ class that permits use of a class as both a monitor and a coroutine (using suspension and resumption as well as mutual exclusion)
  • _Coroutine - an extension of a C++ class that permits coroutine based functionality
  • _Enable - enables non-local exception handling within a task
  • _Disable - disables non-local exception handling within a task (default)
  • _Event
  • _Mutex - enables mutual exclusion on a class member
  • _Nomutex - disables mutual exclusion on a class member
  • _Select - allows blocking on wait for access to a future (Future_ISM<T>, Future_ESM<T>)
  • _Resume
  • _Task - an extension of a C++ class with its own stack and thread control; mutually exclusive by default
  • _Throw - allows non local exception throwing
  • _When - an argument condition to an accept statement similar to a condition

References

External links

Reviews
  • Peter A. Buhr and Richard C. Bilson Examining uC++ // Dr. Dobb's, February 1, 2006