Skip to main content

About Mobicents implementation

11 replies [Last post]
michele83
Offline
Joined: 2007-03-01

Hi guys! I'm studying how mobicents works in a very detailed way.
Does it exits a detailed documentation about the implementation?
E.g. I want to know what a SBB is at SO level (a process? a thread?). How does the event router communicate with the ACs? (via RMI?)

Thank u.
Have a nice day!
Michele

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
michele83
Offline
Joined: 2007-03-01

> Actually there is a thread pool, the size of the
> thread pool is a field in the Event Router
> implementation. (EXECUTOR_POOL_SIZE)
>
> Threads are assigned to activities, each thread can
> be responsible for one or more activity depending on
> the thread pool size and the activity currently
> running on mobicents.
>
> So the relations between threads and activities is
> one-to-many.
>
> Francesco

In my copy of eventrouterimpl.java there is this line:
public static int EXECUTOR_POOL_SIZE = 40;

If I understand, during the execution there are 40 threads (after that the 40th activity has started) and each thread manages a certain number of activities (about number_of_activities/40). Is it right?
Thanks for ur help.
Have a nice day! Michele

Message was edited by: michele83

michele83
Offline
Joined: 2007-03-01

> And this other question still exists...
> > I also don't understand the difference between
> > single-threaded and multi-threaded. Which sort of
> > concurence do we intruduce in the second case?

The sense of the question is: in a single processor system, which is the difference between setting EXECUTOR_POOL_SIZE=1 (i.e. setting SINGLE_THREAD=true) or EXECUTOR_POOL_SIZE=40?

Message was edited by: michele83

fram
Offline
Joined: 2004-05-13

Actually there is a thread pool, the size of the thread pool is a field in the Event Router implementation. (EXECUTOR_POOL_SIZE)

Threads are assigned to activities, each thread can be responsible for one or more activity depending on the thread pool size and the activity currently running on mobicents.

So the relations between threads and activities is one-to-many.

Francesco

eduardomartins
Offline
Joined: 2005-10-10

Right Fran, I meant one thread per activity in concurrent event routing

michele83
Offline
Joined: 2007-03-01

Again about the event router...

I explain why i thought one thread for each event. In the eventrouterimpl.java file there is the "public void routeEvent(EventTypeID eventTypeId, Object event,Object activity, Address address)" method in which appears the following line:

EventExecutor ee = new EventExecutor(new EventPosting(eventTypeId,event, activity, address));

EventExecutor implements runnable so it is a thread... Isn't it?
So for each event, routeEvent is called and so there is a thread for each event.
Where am I wrong?

I also don't understand the difference between single-threaded and multi-threaded. Which sort of concurence do we intruduce in the second case?

Thanks in advance.
Michele

michele83
Offline
Joined: 2007-03-01

> Again about the event router...
>
> I explain why i thought one thread for each event. In
> the eventrouterimpl.java file there is the "public
> void routeEvent(EventTypeID eventTypeId, Object
> event,Object activity, Address address)" method in
> which appears the following line:
>
> EventExecutor ee = new EventExecutor(new
> EventPosting(eventTypeId,event, activity, address));
>
> EventExecutor implements runnable so it is a
> thread... Isn't it?
> So for each event, routeEvent is called and so there
> is a thread for each event.
> Where am I wrong?
>

I think I've resolved this question. There is a queue (QueuedExecutor ) of EventExecutor objects (which are runnable) for each activity. But I still don't understand:
- how does a single thread manage more activities?
- in which order are the events (i.e. the EventExecutor objects in the queues) scheduled?

And this other question still exists...
> I also don't understand the difference between
> single-threaded and multi-threaded. Which sort of
> concurence do we intruduce in the second case?
>
Thanks in advance.
Michele

Message was edited by: michele83

baranowb
Offline
Joined: 2006-01-09

> > Again about the event router...
> >
> > I explain why i thought one thread for each event.
> In
> > the eventrouterimpl.java file there is the "public
> > void routeEvent(EventTypeID eventTypeId, Object
> > event,Object activity, Address address)" method in
> > which appears the following line:
> >
> > EventExecutor ee = new EventExecutor(new
> > EventPosting(eventTypeId,event, activity,
> address));
> >
> > EventExecutor implements runnable so it is a
> > thread... Isn't it?
> > So for each event, routeEvent is called and so
> there
> > is a thread for each event.
> > Where am I wrong?
> >
>
> I think I've resolved this question. There is a queue
> (QueuedExecutor ) of EventExecutor objects (which are
> runnable) for each activity. But I still don't
> understand:
> - how does a single thread manage more activities?
> - in which order are the events (i.e. the
> EventExecutor objects in the queues) scheduled?
>

Events are serialized on AC - meaning one EventExecutor does all the fun with events for one AC (or atleast this is how I remember it now, more or less events are serialized on one object per ac)

>
> And this other question still exists...
> > I also don't understand the difference between
> > single-threaded and multi-threaded. Which sort of
> > concurence do we intruduce in the second case?
> >

Not sure what are You askign here? :) MT laways introduces conurrence :) Maybe with latest Eduardos patches a little bit less than before. But than again events are serialized for ACs.

> Thanks in advance.
> Michele
>
> Message was edited by: michele83

eduardomartins
Offline
Joined: 2005-10-10

Sbb is just a piece of service logic, that is executed by some thread controlled by the event router. AC is the container's representation of an activity, which can be external (a sip transaction, a xmpp connection, a database), it's an abstract concept where events are fired and some state data related with the activity can exist. See JAIN SLEE specs at www.jainslee.org

michele83
Offline
Joined: 2007-03-01

Thank u for your fast answer! U're very kind!
Bye Michele

michele83
Offline
Joined: 2007-03-01

I'm now studying the eventrouter.
I don't understand how many threads are created... One thread for each event? Is it right?

eduardomartins
Offline
Joined: 2005-10-10

It should be one thread for each activity being processed.