Site Map | Contact Us
Quantum Leaps - innovating embedded systems Call us toll-free!
Quantum Developer Zone
Quantum Leaps Discussion Forum

Search the Forum for answers or post your questions to the
Quantum Leaps community


Return to Website

  First
  Prev
  Reply
  Forum
Next  
Last  
Search this Forum:  
Viewing Page 1 of 1 (Total Posts: 5)


Author Comment    
Miro Samek

miro@quantum-leaps.com www.quantum-leaps.com


Apr 8, 08 - 2:28 PM
Quantum Leaps Newsletter, April 08

In this issue:

  • "Practical UML Statecharts in C/C++, Second Edition" (PSiCC2)

  • New Milestone Release QP v4

  • New QP Tutorials

  • "Event-Driven Programming for Embedded Systems" class at the ESC Silicon Valley

  • Book Signing at the ESC Silicon Valley

  • Object-based programming in C






"Practical UML Statecharts in C/C++, Second Edition" (PSiCC2)


PSiCC2

The new, completely revised book "Practical UML Statecharts in C/C++, Second Edition: Event Driven Programming for Embedded Systems" (PSiCC2) is now available for pre-order from Amazon.com and other online book sellers. The book will be published in mid-July.


PSiCC2 is a complete re-write of the first edition and now presents a detailed design study of the new QP v4.0 as well as explanation of all related concepts, such as modern hierarchical state machines (UML statecharts) and event-driven programming with real-time frameworks.


The accompanying website to PSiCC2 is up and running already. You can find there the following information:



  • Excerpts from the book, including the Preface, Introduction, and Chapter 1, which describes a fun, event-driven example of a "Fly 'n' Shoot" game implemented with QP 4.0.

  • Complete source code accompanying the book, including QP/C 4.0.00, QP/C++ 4.0.00, QP-nano 4.0.00, and all examples described in the book. Most of the provided examples can be executed on a standard Windows PC. ARM Cortex-M3 and MSP430 versions of the examples are provided as well.

  • Editorial Review of the book










New Milestone Release QP v4


QP 4.0

The new milestone release QP 4.0.00 is available for
download.


This milestone release is made for the
PSiCC2 book. The standard distributions of QP/C, QP/C++, and QP-nano include very detailed, searchable, hyper-linked Reference Manuals in HTML and CHM formats. The Reference Manuals now replace the "QP Programmer's Manuals" for previous versions 3.x.


QP v4 contains numerous improvements, but perhaps the most important change from the application programmer's perspective is that the coding techniques for state machines have changed in QP v4. While the changes are quite simple, QEP v4 breaks the backward compatibility with QEP 3.x, meaning that some manual changes to the state machines implemented with earlier versions are necessary. Please refer to the links below to find out what's new in QP/C, QP/C++, and QP-nano v4.0.


The standard distributions of QP v4 contain ports to Linux (which covers most POSIX-compliant operating systems), as well as 80x86, ARM Cortex-M3, and MSP430 (QP-nano). The other QP Development Kits (QDKs) will be upgraded to version 4 shortly. Stay Tuned!









New QP Tutorials


QP Tutorials

The new QP 4.0 comes with tutorials that present an example project implemented entirely with the QP event-driven platform using UML state machines and the event-driven paradigm. The example application is an interactive "Fly 'n' Shoot"-type game, which you can run on any PC or on an inexpensive Cortex-M3 development kit. The QP Tutorials are based on Chapter 1 of PSiCC2








"Event-Driven Programming for Embedded Systems" class at the ESC Silicon Valley


ESC SV

April 16, 2008 (Wednesday)

Time:  8:30am-10am (Part 1)

            10:30am-12pm (Part 2)

McEnery Convention Center

San Jose, CA



Miro Samek and Michael Barr present a 3-hour class "Event Driven Programming for Embedded Systems" at the Embedded Systems Conference Silicon Valley (classes [ESC-301] and [ESC-321])


Here is the class abstract:


Most embedded systems are event-driven by nature. Yet, the conventional embedded software architectures, ranging from foreground/background to real-time operating systems (RTOS), are typically not truly event driven. This class helps embedded developers to make the transition from sequential to the modern event-driven programming, which can be one of the trickiest paradigm shifts. ESC SV The class covers such concepts as the inversion of control ("Hollywood principle"), blocking versus non-blocking code, run-to-completion (RTC) execution semantics,
events as objects, the role of event queues, dealing with time, use of state machines to maintain the context, and the concept of a generic, reusable, event-driven framework. The class uses diagrams, code, and examples running on an actual target CPU.




On Wednesday afternoon (April 16) Miro Samek will be signing books at the Elsevier booth #3051. Please stop by to say Hi!



Object-based programming in C


Blog

Check out the state-space blog on EmbeddedGurus.net. The latest post is
about object-based programming in C.


Lawrence C



Apr 9th, 2008 - 11:08 AM
Re: Quantum Leaps Newsletter, April 08

Awesome and perfect timing too, looking forward to getting stuck into 4 for my new project. Where do you find the time Miro? :)
Miro Samek

www.quantum-leaps.com


Apr 12th, 2008 - 7:28 AM
Re: Quantum Leaps Newsletter, April 08

Development kits (QDKs) for Windows have been upgraded to version 4. The QDK/C-Win32 and QDK/C++-Win32 work with Visual C++ 6.0, Visual C++ 2005, and with the GNU compiler under MinGW. The QDKs are available for download from http://www.quantum-leaps.com/win32/.

Miro
Lawrence C



Apr 15th, 2008 - 8:36 AM
Re: Quantum Leaps Newsletter, April 08

I’ve been playing about with 4 for a bit now and have a question about the new publish method. By removing the scheduler locking during publishing, has the potential event reprioritisation bug (the original reason for locking it) not been reintroduced? The new reference counting mechanism works but wouldn’t help prevent this.
Miro Samek

www.quantum-leaps.com


Apr 17th, 2008 - 5:52 PM
Re: Quantum Leaps Newsletter, April 08

Lawrence,

Thank you for the insightful comment, as usual.

The main reason for locking the scheduler during event multicasting in QP v3 was to avoid premature recycling of an event. Consider a scenario in which an event is published by a low-priorty AO to a higher-priority AO. If the scheduler is active, the higher-priority AO immediately preempts the low-priority AO and executes the RTC step. After the RTC step, the high-priority AO will recycle the event, while the event still needs to be posted to other subscribers.

The problem just described has been avoided in QP v4 by incrementing the reference count of the event inside QF::publish() right before multicasting the evnt. This prevents premature recycling of the event just described, so, scheduler locking is not really necessary to achive correct event recycling.

However, you are right that QP v4 will behave possibly differently from QP v3 when executed under a *preemptive kernel" and oublishing occurs from low-priority AOs. I would not call it "reprioritization" of events, becuase events don't have priorities. But I understand that you mean potential reordering of events. Again, for other readers of this forum, the scenario could be as follows. We have three active objects A, B, and C, of priorities low, medium, and high, respectively. Active object B of medim priority publishes an event EVT_1 to A and C. Because in QP v4 the scheduelr is *not* locked, the high-priority AO C immediately preempts the medium-pririty AO B just after the first event posting. Now, assume that C posts an event EVT_2 to A in its RTC step. After this, B resumes and continues multicasting by posting event EVT_1 to A. After all this, the event queue of A has two events (EVT_2, EVT_1) in the reversed order.

In contrast, in QP v3, the high-priority C will only run after the whole multicasting completes, so the queue of AO A will have (EVT_1, EVT_2) in the shown order.

I guess that the general feeling is that QP v3 is more correct by handling multicasting atomically. On the other hand, it requries locking the scheduler for potentially up to 63 event postings, which increases direclty the task level response.

QP v4 does not lock the scheduler, so has a much better task-level response. The ordering of events in QP v4 is maybe less intuitive at a first glance, but is consistent with the model that event publishing is exactly like multiple event postings starting from the highest-priority subscriber.

As they say, every sufficently sophisticated bug is undistinguishible from a feature. I'm not sure if this difference between QP v3 and QP v4 is a bug or a feature. But thank you for bringing this up and giving me an opportunity to explain the difference.

Miro


  First
  Prev
  Reply
  Forum
Next  
Last  


powered by Powered by Bravenet bravenet.com