[jboss-jira] [JBoss JIRA] Commented: (JGRP-457) Optimization: make threads return immediately if NAKACK has another active thread for the same sender

Bela Ban (JIRA) jira-events at lists.jboss.org
Thu May 3 06:00:30 EDT 2007


    [ http://jira.jboss.com/jira/browse/JGRP-457?page=comments#action_12361280 ] 
            
Bela Ban commented on JGRP-457:
-------------------------------

Removed again: we can get into the following situation:
- thread has the CAS, enters the CAS protected area
- thread has no more windows, wants to leave
- before thread leaves, another thread tries to set the CAS var and fails
- now a message is added
- original thread leaves
==> now we have no thread which removes the message above, until we get another message from the same sender or STABLE retransmits the last missing message !

> Optimization: make threads return immediately if NAKACK has another active thread for the same sender
> -----------------------------------------------------------------------------------------------------
>
>                 Key: JGRP-457
>                 URL: http://jira.jboss.com/jira/browse/JGRP-457
>             Project: JGroups
>          Issue Type: Feature Request
>            Reporter: Bela Ban
>         Assigned To: Bela Ban
>            Priority: Minor
>             Fix For: 2.5
>
>
> In NAKACK, when a thread places a message for sender S into the NakReceiverWindow NRW, it subsequently acquires a lock on NRW (lock by sender) and removes as many messages as possible and passes them up.
> If many threads do this at the same time, all threads but one are blocked, and - when finally unblocked - usually return. This causes context switches and possibly cache flushing, so a better way would be to have the threads check whether another thread is already removing messages using a CAS operation *before* acquiring the lock.
> The effect should be that no threads will wait on the lock unnecessarily, and thus fewer context switches, and more threads available to the pool.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list