Real-time Manifest Schema
RTDroid programming model is based on Android’s manifest that extends the schema of Android's basic constructs for real-time properties and defines real-time channels for communication. This article shows: 1) examples of RTDroid's added elements that specify timing requirement, memory bounds and etc. 2) explanation of RTDroid's channel declaration for real-time communication.
Real-time Channel Declaration
<rtdroid:channel name="channel name" type="[ broadcast_intent | rt_handler | broadcast_bulk_intent ]"> <data rtdroid:size="[ data size ]" android:mimeType="[ data type ]" /> </rtdroid:channel>
<rtdroid:channel> is used for channel declaration in RTDroid's programming model, its
type attributes are required, they defines channel events identifier and runtime properties. Notice that RTDroid's channels only support messaging objects with a primitive array, and the length of the primitive array is fixed. The primitive type and length are defined through the
android:mimeType of the
data element. Table. 1 lists the mapping between channel data types of messaging objects and Java primitive types. Table. 2 shows the detailed runtime behavior of each channel in RTDroid.
|android:mimeType||application/octet-stream||application/ rtdroid.int||application/ rtdroid. double|
|primitive type||byte, string||short, int||float, double|
|Channel||Message Delivery Order||Invoked Function Priority||Message Dropping Policy|
|message passing channel||priority inheritance||priority inheritance||FIFO and priority|
|broadcasting channel||priority inheritance||subscriber priority||FIFO and priority|
|bulk data transfer channel||priority inheritance||subscriber priority||FIFO and priority|
Real-time Priority Parameter
<rtdroid:priority scheduler="[ real-time scheduler ]" priority="[ real-time priority ]"/>
rtdroid:priority is used for specifying the real-time scheduler and priority of a real-time construct. The current RTDroid only supports FIFO scheduler, and use a single integer as scheduling priority ranging from 13 to 250. Notice the lowest two priorities (11, 12) and the highest five priorities (251 - 255) are reserved for system components.
<!-- Persistent and release for real-time services and real-time receivers --> <rtdroid:scopeSizes total="1500K" persistent="250K" release="250K"/> <!-- Release memory for periodic task and internal real-time receivers --> <rtdroid:scopeSizes release="1M"/>
<rtdroid:scopeSizes> is used for specifying memory boundary of the real-time construct. RTDRoid's programming model accomplishs memory boundary by leveraging bounded memory regions for each construct, Persistent Memory and Release Memory, with specific lifetimes defined by the lifetime and releases of our constructs respectively. The programmer only needs to specify the size of these memory regions in the manifest, and implementation of our programming model, however must manage these regions.
For every declared component, our programming model ensures exclusive access to an unused region in memory (Persistent Memory). Similarly, our programming model ensures an unused region of memory for every release of a construct (Release Memory). The total memory bound of a real-time construct is the sum of its persistent memory, release memory, and the release memory of their related internal constructs. The internal constructs (periodic tasks or internal receivers) have their own release memory, and share the same persistent memory of their containing real-time service.
<rtdroid:periodic> <period ms="[ milliseconds ]" ns="[ nanoseconds ]" /> <startTime relative="true|false" ms="[ milliseconds ]" ns="[ nanoseconds ]" /> </rtdroid:periodic>
rtdroid:periodic is used for specifying timing requirement, its
period element defines a periodic executing rate, and the
<startTime> sets a relative offset for the first time callback invocation. The
<startTime> is optional, the default offset is 0. ---
Channel Publisher and Subscriber
<rtdroid:service> <intent-filter rtdroid:realtime="[ true|false ]" rtdroid:concurrentCount="[ number of in-flight messages ]" rtdroid:role="[ subscriber | publisher ]"> <action android:name="[ channel name ]"/> </intent-filter> </rtdroid:service>
intent-filter is used for identifying an real-time construct (a real-time service or a real-time receiver) as a publishers or a subscribers of a channel, its
< rtdroid:concurrentCount> is used for specifying the number of messages sent or processed in each callback function execution.
As we discussed in RTDroid's Components Tutorial, The RTDroid's programming model provides two major constructs: the real-time service and the real-time receiver for background tasks, and each of them can be implemented in different forms with different runtime behaviors. Table.3 provides an overview of how to declare different constructs with these discussed elements or attributes. There are a serials of tutorials in another category that details about how to them for real-time development.
|Constructs||Basic Service||Periodic Service||Mission Service||Real-time Receiver|
There is currently no content classified with this term.