You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2009/12/02 09:44:20 UTC

[jira] Created: (FELIX-1913) All synchronous events are processed in one queue

All synchronous events are processed in one queue
-------------------------------------------------

                 Key: FELIX-1913
                 URL: https://issues.apache.org/jira/browse/FELIX-1913
             Project: Felix
          Issue Type: Bug
          Components: Event Admin
    Affects Versions: eventadmin 1.0.0
            Reporter: Carsten Ziegeler


The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794231#action_12794231 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

ah ok. yeah, that would be cool. 

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: ea2.patch

The complete patch

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar

New version

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794023#action_12794023 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

According to my tests the order is now maintained, but performance increases if several threads are posting events...so let's see what the TCK says :)
I've attached the complete patch for the source code as well - currently it requires java 5 - it is more a prototype which might need further cleanup/improvements :)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig commented on FELIX-1913:
------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering why the assumption that events sent by different threads may be processed concurrently. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be concurrent implementations and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:25 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed in parallel.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806361#action_12806361 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I've attached a new patch (and removed all old ones) - the new one adds one feature which is in the original implementation: if sync events are sent nested, the timer for blacklisting a handler is stopped for the outer event while the inner event is sent.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784727#action_12784727 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Ups, yepp, I agree its not a major bug (just used the default....) and yes its more an improvement :)

Ok, yes, I'm talking about synchronous events. If two different threads send an event synchronous, these events are both put into a queue (well in fact the event handlers are put into the queue) and then processed one after the other. I think in this case, the events could be processed in parallel.
The current queueing might block threads sending events synchronously with a high volume of events - now I agree that in most cases async delivery could be used to not block the threads.

The underlying problem is that we are using the event admin for all kinds of notifications - and with a high volume of events the notifications get very slow.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794027#action_12794027 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

This looks better. One question, if a handler gets a timeout are you then still using a new thread to continue the sync dispatch of the event to the other handlers or are you just waiting for the handler to finally return and then blacklist the handler?

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794062#action_12794062 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Uses the util.concurrent? I was thinking about one that doesn't...

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785843#action_12785843 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

As Karl statet the current implementation is according to the spec - however, it is very slow in delivering synchronous events as they are put in in a single queue. Apart from performance, there is no problem with this - but in some cases performance matters, at least a little bit. If you're using the event admin for notifications, especially to give a user a feedback or something like that, it matters if the event takes 2 minutes to be delivered or 100ms. - And yes, these are realistic figures.
The spec allows to dispatch events coming from different threads in parallel. So in your example, if the events come from different threads, there is no particular order mandated from the spec and therefore can safely be processed in parallel.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794042#action_12794042 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

So how do you handle timeouts in the case of stacked sync events then? Are you still preserving the order in that case? I guess i will have to find my old tests and look at your patch. I'll give it a go and report back next week. 

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793996#action_12793996 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I've added the final bundle as I did change a lot :) (Mostly removed stuff which is not needed with a thread pool anymore) - yes, I'm not sure if this is 100% spec compliant - it should be, but the tck check will show this :) Thanks!

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: eventadminfinal.patch)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed FELIX-1913.
-----------------------------------


> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: eventadmin-1.2.2
>
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796587#action_12796587 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Is anything preventing us from committing the code?

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, ea3.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: eventadminfinal.patch

Corrected patch

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793960#action_12793960 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

The processing of async events is very slow as well as they are put in a queue as well - this could be done in parallel, too. In the meantime I've rewritten the event admin as a proof of concept. My version now uses a thread pool (currently from jdk 1.5 - but this can be backportet for older java versions). The events are processed in parallel (if possible) by using this thread pool. This gives a real performance boost with lots of events and several listeners.
Just as an example: I create 1000 events which are sent directly one after the other and 4 listeners - each listeners takes 50ms - each listener gets each event.
As the listeners are processed one after other a single event delivery takes 200ms. The old implementation processes the 1000 events one after the other - so the total delivery time is 1000 * 200ms.
The new implementation takes a configurable thread pool - in my example I use 25 threads - therefore 25 events are processed in parallel, total delivery time goes down to 40 * 200ms

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: ea3.patch)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785333#action_12785333 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I think with the patch in place, the handover handling from the async queue can be removed as well as the new version ensures that the sync event is processed immediately.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785285#action_12785285 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

The patch I applied handles stacked events like this:
- event A comes in and should be delivered to handlers D1 and D2
- D1 is notified first but issues a new event B
- event B is delivered
- D2 gets event A

Now I think that this is the correct handling for sync event handling.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784719#action_12784719 ] 

Marcel Offermans commented on FELIX-1913:
-----------------------------------------

Calling this a major bug is a bit harsh as the spec clearly says that synchronous events can either be handled on the caller's thread or an event delivery thread. I agree that for multi-core systems, having a single thread might not be the fastest solution. Perhaps Karl can explain his design choices here?

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Bug
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:26 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed in parallel.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation in which the same end-point-sender may not send its events via the same thread - maybe such a situation is possible and thus may be a problem for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed in parallel.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation in which the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls updated FELIX-1913:
------------------------------

      Priority: Minor  (was: Major)
      Assignee: Karl Pauls
    Issue Type: Improvement  (was: Bug)

I don't think this a bug at all - so retagging as Improvement. 

Furthermore, from your description I can't really tell whether you aren't asking for something that is not possible. You can't have synchronous events delivered in parallel as they need to be stacked if an event delivery results in a new event being send plus events need to be observed in order. The spec is very clear on that (we pass the 4.2 tck for eventadmin btw.). Are you talking about synchronous delivery?

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:26 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed in parallel.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation in which the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed in parallel.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:25 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial (in the ordering that is applicable due to the spec). However, if two or more events are sent by two different threads, the two event series are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Description: 
The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
In the async mode, event deliver might take a long time as these events are processed one after the other as well.

  was:The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

        Summary: All events are processed in a queue  (was: All synchronous events are processed in one queue)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785281#action_12785281 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Well, as you discovered, and as I already mentioned, the issue is that you have to make sure that events are observed in the right order (including the stacking of events) on a per thread basis. I was thinking that you where talking about the case of parallel delivery of the same event. I agree that you should be able to deliver events from different threads in parallel. 

Just make sure that for each parallel thread you do the right thing if it comes back into the ea (i.e., stacks a new event) even if you use a new one from the thread pool. 

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: eventadminfinal.patch

New Version

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: ea.patch

Prototype for a fix

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794057#action_12794057 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

yes, it seems to be passing now. i will try to add a thread pool that doesn't require java5 and then we might be good to go. Cool stuff.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794059#action_12794059 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I've an older thread pool implementation lying around which uses the util.concurrent package (and provides the same functionality)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: ea3.patch

Complete patch for a java 1.5 free version

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, ea3.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785611#action_12785611 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Great. I will have a look at your patch on the weekend. Thanks.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: ea2.patch)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828832#action_12828832 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Looks good to me for now. Thanks for getting all the stuff back working. I think you can commit this now so that it is easier for others to take it for a spin. Thanks again.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794363#action_12794363 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I've attached a complete new patch which uses the concurrent library instead of the java 1.5 stuff

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, ea3.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784783#action_12784783 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Yes, thanks Marcel - that's the paragraph I'm refering to :)
The only question might be, if you have a two receivers A and B for an event. A gets the event first and issues new events via sendEvent. Is it required to send the first request to B, before the new events are distributed? I didn't found something about this in the spec.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved FELIX-1913.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: eventadmin-1.2.0

I've applied the patch in revision 905914.
I'm now setting this bug to fixed; if we find new problems we should open new issues.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: eventadmin-1.2.0
>
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment: org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar

Prototype using thread pools

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785247#action_12785247 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I'Ve attached a prototype for an improvement - it is clearly not the final solution.
I've changed the thread pool to work with plain Runnable's
and then just changed the execute method of the sync handler: the event handlers are processed one after the other.
If no timeout is set, the handlers are called directly
If a timeout is set, the handlers are called by a thread from the thread pool and blacklisting is also handled.
This allows to process events in parallel when they come from different threads.

I did some basic tests and it seems to work (incl. blacklisting etc.)



> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:24 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation s possible and thus may be a problem for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794066#action_12794066 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

I mean the library for java 1.3 or 1.4 - not the package in java 1.5 :)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784739#action_12784739 ] 

Marcel Offermans commented on FELIX-1913:
-----------------------------------------

Karl, I think it would be more correct to say that synchronous events from the same thread cannot be delivered in parallel as the spec states that these should be processed serially and in the same order. However, the spec also states that no such guarantees can be made for synchronous events sent from different threads. These might well be processed in parallel (see 113.7.3 about Order of Event Delivery, second paragraph).

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794044#action_12794044 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Yes, the order is preserverd - however if an event handler takes longer than the timeout, this handler still runs when the next event from the stack is processed.
I've run it through my tests and they look fine (which is obvious as the whole point of this change is to make my tests look good), so I'm looking forward to your additional tests.
By this, I assume the TCK runs fine on the implementation, right?

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794034#action_12794034 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Yes, more or less :) Each event handler is sent the event with a new thread. If you have two event handlers for a given event, the second handler is called either when the first one returns (within the timeout) or as soon as the timeout occurs. In this case the first handler is immediately blacklisted - so a handler is blacklisted as soon as the timeout is reached and other handlers get called immediately.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, ea2.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:22 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be concurrent implementations and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering why the assumption that events sent by different threads may be processed concurrently. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be concurrent implementations and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned FELIX-1913:
---------------------------------------

    Assignee: Carsten Ziegeler  (was: Karl Pauls)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794006#action_12794006 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Ah yes, the order is not maintained in the async case :) I did overlook the second sentence in the spec....I'll try to fix this today and then give you the patch :)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794000#action_12794000 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Well, as i did say, we have to make sure we maintain the order of events and it did sound like you don't. Sure enough, your implementation doesn't pass the tck (complains about out-of-order delivery :-). Can you try to get me a patch (then i will have a look during the chrismas break)?

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch, org.apache.felix.eventadmin-1.0.1-SNAPSHOT.jar
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785833#action_12785833 ] 

Sven Ludwig edited comment on FELIX-1913 at 12/4/09 9:22 AM:
-------------------------------------------------------------

Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be a multi-threaded implementation and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.

      was (Author: sludwig):
    Hello, I find this an interesting thread and want to contribute with a question. First, what I have understood is that for one event-sending thread the events will be processed in serial. However, if two events are sent by two different threads, the events are processed concurrently.

I am wondering if and why the assumption that events sent by different threads may be processed concurrently holds. This is just a question out of interest, and maybe it helps to clarify the situation even more. I am considering a situation in which the event sender (wherever the events come from) may be concurrent implementations and thus the same end-point-sender may not send its events via the same thread - maybe such a situation exists and thus may be a problem here for the patch.
  
> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All synchronous events are processed in one queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784789#action_12784789 ] 

Carsten Ziegeler commented on FELIX-1913:
-----------------------------------------

Just rethinking about my question I come to the conclusion that if A sends new events these have to be sent before B gets the first event. Otherwise the spec would be violated for A sending events.

> All synchronous events are processed in one queue
> -------------------------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>
> The current event admin implementation puts all events into one single queue and processes this queue is in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1913) All events are processed in a queue

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated FELIX-1913:
------------------------------------

    Attachment:     (was: ea.patch)

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: eventadminfinal.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1913) All events are processed in a queue

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793984#action_12793984 ] 

Karl Pauls commented on FELIX-1913:
-----------------------------------

Can you attach the patch for the concurrent async delivery? I'm not sure that we can get the speed-up you see as events have to be delivered in order if they are posted by the same thread. In other words, we have to make sure that we account for a handler that turns around and posts a new event. For sure, we can have each event delivered in parallel. If you attach the patch I'll run it through the tck.

> All events are processed in a queue
> -----------------------------------
>
>                 Key: FELIX-1913
>                 URL: https://issues.apache.org/jira/browse/FELIX-1913
>             Project: Felix
>          Issue Type: Improvement
>          Components: Event Admin
>    Affects Versions: eventadmin 1.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Karl Pauls
>            Priority: Minor
>         Attachments: ea.patch
>
>
> The current event admin implementation puts all events into a  queue and processes this queue in one thread. This creates a bottleneck when different threads send events as they have to wait for other threads to be processed first. Events from different threads can be processed in parallel.
> In the async mode, event deliver might take a long time as these events are processed one after the other as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.