Search the Forum for answers or post your questions to the
Quantum Leaps community
|
| Home | | | Products | | | Services | | | Downloads | | | Licensing | | | Developer Zone | | | Resources |
![]() |
| Overview | | | Discussion | | | Cookbook | | | Design Patterns | | | Bugs | | | Contributions | | | Credits |
Quantum Leaps Discussion Forum
Search the Forum for answers or post your questions to the |
||
| Return to Website | ||
| Viewing Page 1 of 1 (Total Posts: 5) |
| Author | Comment |
Miro Samek
Apr 8, 08 - 2:28 PM |
Quantum Leaps Newsletter, April 08
In this issue:
"Practical UML Statecharts in C/C++, Second Edition" (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:
New Milestone Release QP v4![]() The new milestone release QP 4.0.00 is available for This milestone release is made for the 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! Download QP 4.0.00 » Revision history of QP/C » Revision history of QP/C++ » Revision history of QP-nano » New 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![]() April 16, 2008 (Wednesday) 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. 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![]() Check out the state-space blog on EmbeddedGurus.net. The latest post is |
Lawrence C
Apr 9th, 2008 - 11:08 AM |
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
Apr 12th, 2008 - 7:28 AM |
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 |
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
Apr 17th, 2008 - 5:52 PM |
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 |
bravenet.com| Privacy Statement | About Us | Contact Us | © 2004-2005 quantum Leaps. All rights reserved. |