|
|
|
|
|
|
|
|
Empress Technical News – July 2009 Empress API Cancel Functionality–
IntroductionEmpress Ultra Embedded 10.20 offers many useful features for application developers. One of those features is the Cancel Functionality for Empress C/C++ Kernel Level API mr routines. Empress Cancel Functionality How many times you found yourself in the situation when you had just started an interactive database task and realized it was taking too long to finish? How many times have you found yourself in the situation where you selected and sorted 20GB of Wikipedia data on a PDA without the right index and were waiting forever? How many times you found yourself in the situation when you invoked the wrong task by accident and could not stop it unless you pressed “FACTORY RESET”? All those situations can be under your control by using the new Empress Cancel Functionality. Empress Ultra Embedded V10.20 Cancel Functionality powers-up application developers to implement an effective interactive response for their real-time applications. All Empress Kernel Level API mr routines are synchronous in nature. After an application calls a mr routine, it has to wait until the Empress database engine completes all internal operations in regards to that specific mr routine. Then the question arises: how one can cancel a synchronous processing of any mr routine? Let’s assume that an application performs database tasks using Empress mr routines API in one thread of execution – we will call this thread a worker thread. Empress new Cancel Functionality utilizes another thread of execution to check each mr routine executing in the worker thread and cancel its operation. The Cancel Functionality has been developed as an additional set of Empress C/C++ Kernel Level API mr routines. Empress Cancel Functionality mr C APIThe Empress cancel functionality is developed via the following set of additional Empress C/C++ Kernel Level API – mr routines: mrenableconn()-
turn off Cancel flag for that task Example Pseudo Code Using Cancel FunctionalityIn the following pseudo code example cancel_db_task starts two threads, a worker thread where all database tasks are performed and a main thread used for canceling mr routines in the worker thread. Cancel activity is triggered by invoking the mr routine mrdisableconn(). The pseudo code example cancel_db_task is as follows: /**** cancel_db_task ****/ Main(UI) Thread: .. Thediagram in the Fig 1 shows the simplified flow of activities in the pseudo code example cancel_db_task.
Fig 1: Empress Cancel Functionality
Instead of Summary Empress Cancel functionality can be extremely useful for developers of interactive applications. On the other hand, developers may find that Empress Timeout functionality may be more convenient for those applications that run without user interaction. It’s your choice!!! Empress
Software Inc. |
|
Company |
Products |
Services |
Partners |
Media |
|
|
USA: 301-220-1919 Canada
& International: 905-513-8888 |
|||||