Actor-based framework for SunSPOTs

For my master thesis did I made an Actor-based framework for SunSPOTs.

Background

The actor model for programming is getting more and more common. The model can be used to program both distributed programs and to program more than one  core in multi core systems.

Languages which use the actor model is Erlang and Scala the most populars ones. Scala do even run on the JVM. Erlang is made of Ericsson in Sweden and have been used in telephones systems since 1984.

There do not exists an actor framework for the SunSPOT, so I sat out to make one.

The SunSPOT

The SunSPOT provide a SquawkVM, which support the CLDC and MIDlet. When sending messages using the built-in radio communication on the SunSPOT it is not possible to get an acknowlegde of the message sent. Therefore a communication layer is made, which is added to make sure that every message is received at the end, if the host exists, else an error is returned to the user.

User Interface

To make it easy for the user to use the framework, is the interface reduced to only nine functions.

Load balancing

To make load balancing is the load calculated and send out to the others SunSPOTs using broadcasts. This was not possible to do. Somehow did the broadcast messages not received, so this part was set on hold. 

Actors

The actors of the system is implemented using a Thread. The actor class is an abstract class which the user must extend to use the functions given in the actor. The actor acts as an entrance to the MCP. The user must implement the run method of the actor, to get the actor do some work. Each actor have an unique id used in communication.

MCP

The MCP (Master Control Program) is a class which holds function to create other actors, and handling messages. The actor ask the MCP to create an actor, local or non-local. The actor then ask the non-local MCP to create the actor, and returns the id to the calling actor.

Messages

There are different kind of messages in the system, which is send to different parts of the program.

 

But read more and see the dirty code in my thesis

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

David Askirk

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today