You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Afkham Azeez <af...@gmail.com> on 2014/11/25 08:44:36 UTC

Threading model for Stratos

I have been involved in a few Stratos code reviews, and one of the major
issues I noted in many places is that Stratos does not have a proper
threading model. Threads are created as and when needed in many places. In
fact, there were instances where threads were spawned from within the run
method of other threads! Then there are instances of while(true) loops
inside the run methods.

All that code has to be reviewed and cleaned up. We need to have proper
thread pools defined. The pool sizes should be configurable, and have to
use the ExecutorService in the relevant places.

IMO, this has to be fixed soon before this bad practice gets adopted in new
code as well.

-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com,
*Member; Apache Software Foundation; **http://www.apache.org/*
<http://www.apache.org/>

*email: **azeez@wso2.com* <az...@wso2.com>
* cell: +94 77 3320919blog: **http://blog.afkham.org*
<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*
<http://twitter.com/afkham_azeez>
*linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*

Re: Threading model for Stratos

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Azeez,

>
> On Tue, Nov 25, 2014 at 1:14 PM, Afkham Azeez <af...@gmail.com> wrote:
>
>> I have been involved in a few Stratos code reviews, and one of the major
>> issues I noted in many places is that Stratos does not have a proper
>> threading model. Threads are created as and when needed in many places. In
>> fact, there were instances where threads were spawned from within the run
>> method of other threads! Then there are instances of while(true) loops
>> inside the run methods.
>>
>> +1 I cleaned up above mentioned while(true) loops with the following
commit:
https://github.com/apache/stratos/commit/e20119c357d856543e06cc1faad2052fd6759100

Will do necessary modifications to clean up the threading model as well.

Thanks

Re: Threading model for Stratos

Posted by Lakmal Warusawithana <la...@wso2.com>.
Thanks Azeez for bring this up, yes will address with before the next
release.

On Tue, Nov 25, 2014 at 1:14 PM, Afkham Azeez <af...@gmail.com> wrote:

> I have been involved in a few Stratos code reviews, and one of the major
> issues I noted in many places is that Stratos does not have a proper
> threading model. Threads are created as and when needed in many places. In
> fact, there were instances where threads were spawned from within the run
> method of other threads! Then there are instances of while(true) loops
> inside the run methods.
>
> All that code has to be reviewed and cleaned up. We need to have proper
> thread pools defined. The pool sizes should be configurable, and have to
> use the ExecutorService in the relevant places.
>
> IMO, this has to be fixed soon before this bad practice gets adopted in
> new code as well.
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com,
> *Member; Apache Software Foundation; **http://www.apache.org/*
> <http://www.apache.org/>
>
> *email: **azeez@wso2.com* <az...@wso2.com>
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* <http://blog.afkham.org>
> *twitter: **http://twitter.com/afkham_azeez*
> <http://twitter.com/afkham_azeez>
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> <http://lk.linkedin.com/in/afkhamazeez>*
>
> *Lean . Enterprise . Middleware*
>
>


-- 
Lakmal Warusawithana
Vice President, Apache Stratos
Director - Cloud Architecture; WSO2 Inc.
Mobile : +94714289692
Blog : http://lakmalsview.blogspot.com/