FAQ: Threading and JVM

Discussion about aJile's Runtime

FAQ: Threading and JVM

Postby admin » Sat Nov 04, 2006 6:34 am

What "operating systems" are used with the aJile processors?

aJile processors have a microprogrammed real-time kernel that is internal to the processor. The microprogrammed kernel performs the traditional operating system functions (scheduling, context switching, interrupt preprocessing, error preprocessing, object synchronization). Java threads are native threads on the aJile processor. In addition, extended bytecodes are used to implement Java threading primitives such as sleep, wait, notify, notifyall, yield, monitor enter, monitor exit, and interrupt to provide extremely fast and atomic (non-interruptable) executive operations. These primitives are incorporated in the aJile Java runtime system such that the traditional operating system layer is not required.
Last edited by admin on Mon Nov 06, 2006 10:24 pm, edited 1 time in total.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:03 am

What type of scheduling is implemented in the aJile processors?

The microprogrammed kernel implements priority preemptive scheduling. The highest priority "ready" thread is always selected to run. Thread priorities can be manipulated via the getPriority() and setPriority() methods from the Java threading API.
Last edited by admin on Sun Nov 05, 2006 7:05 am, edited 1 time in total.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:05 am

Do aJile processors support deterministic thread scheduling?

The aJile runtime system includes a periodic thread class to provide deterministic activation of threads. The periodic thread class is used to setup the priority and period of the thread. A periodic thread must programmed with an outer "infinite" loop containing an invoke to the cycle() method. The cycle() method simply suspends the periodic thread until the next activation time. A cyclic hardware timer drives the activation of periodic threads.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:06 am

How many priority levels do aJile processors support?

aJile processors support 32 priority levels. The (10) "Java" priorities are mapped to the even priorities from 2 to 20. The odd priorities from 3 to 21 are used for periodic threads and the priorities above 21 are used for high priority system threads such as the garbage collector.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:07 am

Does aJile provide any "deadlock" prevention protocols?

aJile processors support a priority ceiling protocol for synchronized objects. This is accomplished via assigning a synchronized object a "ceiling" priority equal to the priority of the highest priority thread that may access it (via the setCeiling() method). Any thread accessing the synchronized object will have its priority temporarily raised to the "ceiling" priority and returned to its original priority upon releasing it.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:07 am

Is there a limit on the number of threads?

The number of threads that can be created is determined by the available RAM memory for the thread object and its stack. The thread object is about 160 bytes and the stack size is 1K bytes by default. The stack size can be changed in the JEM builder tool.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:07 am

Is there a limit on the number of threads in threading queues?

There are no limits on the threading queues but there are caveats. Interrupts are disabled when threading queues are being manipulated by the kernel or threading instructions. Most threading queue operations are fast (microseconds or less) but inserting a thread in a large sleep queue (10s of threads) requires examining thread delay times starting from the shortest to the insertion point.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:08 am

How are threads queued for synchronized blocks

When multiple threads are waiting for a synchronized block, the highest priority thread is granted access when it becomes available.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:08 am

What type of garbage collector is available?

The aJile Java runtime system currently supports a mark and sweep garbage collector.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:09 am

Does aJile's implement the Real-Time Specification for Java (RTSJ)?

aJile's microprogrammed RTOS has most of the functionality specified in the RTSJ including a priority preemptive schedular, 32 priority levels, ceiling semaphore protocol, periodic threads, non collected heaps, etc. However, compliance to the RTSJ will require business initiatives to pursue.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:09 am

How is the JVM implemented in aJile processors?

aJile processors are an optimal implementation of the JVM since the Java bytecodes are the native instruction set. The native JVM bytecode implementation eliminates the typical interpreter or JIT software layers and provides the most efficient Java performance in both memory requirements and execution time.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:10 am

Which JVM bytecodes are implemented?

aJile processors implement the entire JVM bytecode instruction set. Additional memory access and threading instructions are defined using the extended bytecode mechanism.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:10 am

How are extended bytecode instructions generated from Java code?

The aJile runtime system defines "signatured" methods (rawJEM class) corresponding to the extended bytecodes. Utilizing the extended bytecode is simply a matter of using the corresponding method and its parameters. During build time, the aJile tool chain replaces invokes to signatured methods with the corresponding extended bytecode for the target load image.
[Append to This Answer]
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:11 am

How are peripherals accessed in Java?

The rawJEM class includes methods corresponding to "peek" and "poke" extended bytecodes to access memory mapped peripherals. The memory address is an integer parameter to these instructions and various data widths are available.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:11 am

I run my program, and interrupts are no longer serviced. What is going on?

Some thread is running at priority level 31 (interrupt level priority) and is hogging the processor. This has the effect of disabling all interrupts.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Next

Return to Runtime

Who is online

Users browsing this forum: No registered users and 0 guests

cron