[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2021-09-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17418792#comment-17418792
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit bf1359829afbf126ad5dc0dd6bf76ebf34f08bac in qpid-dispatch's branch 
refs/heads/main from Ken Giusti
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=bf13598 ]

DISPATCH-1274: avoid sharing mutex between timer and server

Historically the qd_server_t and the timer subsystem have shared a
single mutex. There is no technical reason for this as each use the
lock to protect entirely separate critial sections.

Recent analysis of lock usage shows that the timer subsystem makes
heavy use of the lock.  This patch introduces separate locks as to
avoid any contention between the qd_server_t and timer operations.

This closes #1350


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Ken Giusti
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2021-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17418793#comment-17418793
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

asfgit closed pull request #1350:
URL: https://github.com/apache/qpid-dispatch/pull/1350


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Ken Giusti
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2021-08-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17404784#comment-17404784
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

codecov-commenter commented on pull request #1350:
URL: https://github.com/apache/qpid-dispatch/pull/1350#issuecomment-905946379


   # 
[Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/1350?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#1350](https://codecov.io/gh/apache/qpid-dispatch/pull/1350?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (85dd4e6) into 
[main](https://codecov.io/gh/apache/qpid-dispatch/commit/10a0a56db2b83fef6271d9413d36b8efd240f071?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (10a0a56) will **decrease** coverage by `0.10%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/graphs/tree.svg?width=650=150=pr=rk2Cgd27pP_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/qpid-dispatch/pull/1350?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ## main#1350  +/-   ##
   ==
   - Coverage   84.72%   84.61%   -0.11% 
   ==
 Files 114  114  
 Lines   2840428405   +1 
   ==
   - Hits2406424034  -30 
   - Misses   4340 4371  +31 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/qpid-dispatch/pull/1350?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[src/server.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3NlcnZlci5j)
 | `86.22% <100.00%> (ø)` | |
   | 
[src/timer.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3RpbWVyLmM=)
 | `96.85% <100.00%> (+0.02%)` | :arrow_up: |
   | 
[src/iterator.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL2l0ZXJhdG9yLmM=)
 | `89.29% <0.00%> (-3.88%)` | :arrow_down: |
   | 
[src/router\_core/agent\_address.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3JvdXRlcl9jb3JlL2FnZW50X2FkZHJlc3MuYw==)
 | `88.18% <0.00%> (-1.58%)` | :arrow_down: |
   | 
[src/router\_core/connections.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3JvdXRlcl9jb3JlL2Nvbm5lY3Rpb25zLmM=)
 | `89.28% <0.00%> (-1.18%)` | :arrow_down: |
   | 
[src/router\_core/delivery.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3JvdXRlcl9jb3JlL2RlbGl2ZXJ5LmM=)
 | `93.90% <0.00%> (ø)` | |
   | 
[src/message.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL21lc3NhZ2UuYw==)
 | `87.55% <0.00%> (+0.06%)` | :arrow_up: |
   | 
[src/router\_node.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL3JvdXRlcl9ub2RlLmM=)
 | `93.55% <0.00%> (+0.09%)` | :arrow_up: |
   | 
[src/adaptors/tcp\_adaptor.c](https://codecov.io/gh/apache/qpid-dispatch/pull/1350/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-c3JjL2FkYXB0b3JzL3RjcF9hZGFwdG9yLmM=)
 | `77.36% <0.00%> (+0.21%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/1350?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 

[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2021-08-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17404708#comment-17404708
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

kgiusti opened a new pull request #1350:
URL: https://github.com/apache/qpid-dispatch/pull/1350


   Historically the qd_server_t and the timer subsystem have shared a
   single mutex. There is no technical reason for this as each use the
   lock to protect entirely separate critial sections.
   
   Recent analysis of lock usage shows that the timer subsystem makes
   heavy use of the lock.  This patch introduces separate locks as to
   avoid any contention between the qd_server_t and timer operations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Ken Giusti
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Alan Conway (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800983#comment-16800983
 ] 

Alan Conway commented on DISPATCH-1274:
---

The issue this patch was aiming at is a set of often-called code points that 
*always* pass a literal 0 to schedule() just to put work on other threads. 
Those uses don't need a timed delay, just a thread-safe work queue. The 
overhead of clock_time() and a sorted schedule is always wasted for those 
calls. For code that actually is trying to set up a timed delay, I think the 
existing timers are fine - even if the delay sometimes happens to be 0.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Gordon Sim (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800889#comment-16800889
 ] 

Gordon Sim commented on DISPATCH-1274:
--

I would think checking for 0 and calling some immediate scheduling if needed, 
and scheduling a non-zero timeout otherwise would be more obvious in its 
intention.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Cliff Jansen (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800883#comment-16800883
 ] 

Cliff Jansen commented on DISPATCH-1274:


The connector timer is sometimes zero and sometimes non-zero.

Perhaps its use is infrequent enough that it doesn't need to have special code 
to prevent collisions between a regular and immediate timers, and can just use 
the former.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Gordon Sim (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800828#comment-16800828
 ] 

Gordon Sim commented on DISPATCH-1274:
--

Yes, I think that would actually be cleaner.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Alan Conway (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800824#comment-16800824
 ] 

Alan Conway commented on DISPATCH-1274:
---

Another way to fix this would be to introduce an explicit "immediate" API 
rather than making it an optimization of timer_schedule(0). There are only a 
couple of places that make immediate calls an they are easy to separate from 
normal timer use.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800814#comment-16800814
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit d1ae9134dfd9918088d0afbbbc344a1eef2cb2d0 in qpid-dispatch's branch 
refs/heads/master from Ganesh Murthy
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=d1ae913 ]

DISPATCH-1274 - Missed out removing immediate.c from the previous commit. 
Removed it now


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800803#comment-16800803
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit 35a2cff60a515b080eba6fcf4e43672557cca1f1 in qpid-dispatch's branch 
refs/heads/master from Ganesh Murthy
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=35a2cff ]

DISPATCH-1274 - This commit reverts 48e62a11e67cf3a37b5e1f9862d07a939101cdb4 
and 077710c72a20f854e9fe0cbcd983ba68c4d72d10. This code caused a deadlock in 
the timer.


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Gordon Sim (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800802#comment-16800802
 ] 

Gordon Sim commented on DISPATCH-1274:
--

Another option might be the following, which I think would keep the 
optimisation for the first 256 timers (I suspect it is only one or two of the 
fixed ones that actually use 0 timeoutes anyway, the per connection ones 
certainly don't).

{noformat}
diff --git a/src/immediate.c b/src/immediate.c
index 5b1cab9e..87402b3f 100644
--- a/src/immediate.c
+++ b/src/immediate.c
@@ -47,7 +47,7 @@ void qd_immediate_finalize(void) {
 qd_immediate_t *qd_immediate(qd_dispatch_t *qd, void (*handler)(void*), void* 
context) {
 sys_mutex_lock(lock);
 if (count >= sizeof(immediates)/sizeof(immediates[0])) {
-assert("exceeded max number of qd_immediate_t objects" == 0);
+sys_mutex_unlock(lock);
 return 0;
 }
 qd_immediate_t *i = [count++];
diff --git a/src/timer.c b/src/timer.c
index c76f77dd..06d898c1 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -55,7 +55,7 @@ static void timer_cancel_LH(qd_timer_t *timer)
 DEQ_INSERT_TAIL(idle_timers, timer);
 timer->scheduled = false;
 }
-qd_immediate_disarm(timer->immediate);
+if (timer->immediate) qd_immediate_disarm(timer->immediate);
 }
 
 /* Adjust timer's time_base and delays for the current time. */
@@ -112,7 +112,7 @@ void qd_timer_free(qd_timer_t *timer)
 sys_mutex_lock(lock);
 timer_cancel_LH(timer);
 DEQ_REMOVE(idle_timers, timer);
-qd_immediate_free(timer->immediate);
+if (timer->immediate) qd_immediate_free(timer->immediate);
 sys_mutex_unlock(lock);
 free_qd_timer_t(timer);
 }
@@ -128,7 +128,7 @@ qd_timestamp_t qd_timer_now() {
 void qd_timer_schedule(qd_timer_t *timer, qd_duration_t duration)
 {
 sys_mutex_lock(lock);
-if (duration == 0) {
+if (duration == 0 && timer->immediate) {
 qd_immediate_arm(timer->immediate);
 sys_mutex_unlock(lock);
 return;
@@ -208,7 +208,7 @@ void qd_timer_visit()
 qd_timer_t *timer = DEQ_HEAD(scheduled_timers);
 while (timer && timer->delta_time == 0) {
 timer_cancel_LH(timer); /* Removes timer from scheduled_timers */
-qd_immediate_disarm(timer->immediate);
+if (timer->immediate) qd_immediate_disarm(timer->immediate);
 sys_mutex_unlock(lock);
 timer->handler(timer->context); /* Call the handler outside the lock, 
may re-schedule */
 sys_mutex_lock(lock);
{noformat}

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Alan Conway (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800794#comment-16800794
 ] 

Alan Conway commented on DISPATCH-1274:
---

That part of the change (using an array instead of a linked list for timer 
lookup) can be backed out separately if desired. Otherwise the whole thing can 
be backed out for now since there isn't strong evidence that it provides a big 
speed up.

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-25 Thread Ganesh Murthy (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800716#comment-16800716
 ] 

Ganesh Murthy commented on DISPATCH-1274:
-

The following is a comment from [~gsim]

"This is a deadlock in the timer systems caused by DISPATCH-1274. That 
 optimisation assumes there will never be more than 256 timers. However 
 if initialHandshakeTimeoutSeconds is set on a listener, there will be a 
 timer created for every connection.
 
 I'd suggest perhaps we consider backing out DISPATCH-1274 for now as it 
 an optimisation rather than a crucial feature or fix."

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16785968#comment-16785968
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

asfgit commented on pull request #456: DISPATCH-1274: fix for travis build
URL: https://github.com/apache/qpid-dispatch/pull/456
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16785959#comment-16785959
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

codecov-io commented on issue #456: DISPATCH-1274: fix for travis build
URL: https://github.com/apache/qpid-dispatch/pull/456#issuecomment-470211266
 
 
   # 
[Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=h1) 
Report
   > :exclamation: No coverage uploaded for pull request base 
(`master@077710c`). [Click here to learn what that 
means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/qpid-dispatch/pull/456/graphs/tree.svg?width=650=rk2Cgd27pP=150=pr)](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=tree)
   
   ```diff
   @@Coverage Diff@@
   ## master #456   +/-   ##
   =
 Coverage  ?   86.94%   
   =
 Files ?   86   
 Lines ?18842   
 Branches  ?0   
   =
 Hits  ?16383   
 Misses? 2459   
 Partials  ?0
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[src/immediate.c](https://codecov.io/gh/apache/qpid-dispatch/pull/456/diff?src=pr=tree#diff-c3JjL2ltbWVkaWF0ZS5j)
 | `97.43% <ø> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=footer).
 Last update 
[077710c...f1bb22d](https://codecov.io/gh/apache/qpid-dispatch/pull/456?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16785904#comment-16785904
 ] 

ASF GitHub Bot commented on DISPATCH-1274:
--

grs commented on pull request #456: DISPATCH-1274: fix for travis build
URL: https://github.com/apache/qpid-dispatch/pull/456
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
> Fix For: 1.6.0
>
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-05 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16784915#comment-16784915
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit 48e62a11e67cf3a37b5e1f9862d07a939101cdb4 in qpid-dispatch's branch 
refs/heads/master from Alan Conway
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=48e62a1 ]

DISPATCH-1274: Optimize qd_timer_schedule(0)

Introduced pn_immediate_t, a simpler schedule for immediate requests.
qd_timer_schedule delegates schedule(0) requests.


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-05 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16784916#comment-16784916
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit 077710c72a20f854e9fe0cbcd983ba68c4d72d10 in qpid-dispatch's branch 
refs/heads/master from Alan Conway
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=077710c ]

DISPATCH-1274: Separate qd_timer_t lock from server

qd_timer_t was sharing a lock with qd_server_t for historical reasons.
Code inspection shows there is no need for the sharing.

- timer.c calls qd_server_timeout() which is thread-safe, and no other server 
functions.
- timer calls handlers outside the lock so it doesn't mater what lock is used.


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-01 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782020#comment-16782020
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit 9c2371e9628aee40356fbea36e3b53493b0a0853 in qpid-dispatch's branch 
refs/heads/schedule-zero from Alan Conway
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=9c2371e ]

DISPATCH-1274: Separate qd_timer_t lock from server

qd_timer_t was sharing a lock with qd_server_t for historical reasons.
Code inspection shows there is no need for the sharing.

- timer.c calls qd_server_timeout() which is thread-safe, and no other server 
functions.
- timer calls handlers outside the lock so it doesn't mater what lock is used.


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-01 Thread Alan Conway (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782023#comment-16782023
 ] 

Alan Conway commented on DISPATCH-1274:
---

Proposed fix on 
[https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;a=shortlog;h=refs/heads/schedule-zero]

I'm not seeing any impressive changes from this fix, so I'm leaving it on a 
branch for further evaluation for now.

 

> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-1274) Optimize qd_timer_schedule(0)

2019-03-01 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/DISPATCH-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782019#comment-16782019
 ] 

ASF subversion and git services commented on DISPATCH-1274:
---

Commit de5c509d073f279a5b8b38016e8555b13e7a in qpid-dispatch's branch 
refs/heads/schedule-zero from Alan Conway
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=de5c509 ]

DISPATCH-1274: Optimize qd_timer_schedule(0)

Introduced pn_immediate_t, a simpler schedule for immediate requests.
qd_timer_schedule delegates schedule(0) requests.


> Optimize qd_timer_schedule(0) 
> --
>
> Key: DISPATCH-1274
> URL: https://issues.apache.org/jira/browse/DISPATCH-1274
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.5.0
>Reporter: Alan Conway
>Assignee: Alan Conway
>Priority: Major
>
> qd_timer_schedule() uses the general timeout mechanisms which includes 
> checking system time (on schedule and on PN_PROACTOR_TIMEOUT wakeup) and 
> adding/removing work items from sorted list. Optimize the schedule(0) case as 
> a simple work_list using pn_proactor_interrupt() for wakeups.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org