You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/02/18 09:22:20 UTC

[jira] [Resolved] (WICKET-5508) Memory model improvements for Session fields

     [ https://issues.apache.org/jira/browse/WICKET-5508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-5508.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.15.0
                   7.0.0

> Memory model improvements for Session fields
> --------------------------------------------
>
>                 Key: WICKET-5508
>                 URL: https://issues.apache.org/jira/browse/WICKET-5508
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.13.0
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>             Fix For: 7.0.0, 6.15.0
>
>         Attachments: WICKET-5508.patch, WICKET-5508.patch, WICKET-5508.patch
>
>
> Currently org.apache.wicket.Session#sequence and org.apache.wicket.Session#pageId are primitive ints, non-volatile.
> They are accessed only in their getter methods where they are read and incremented. To make sure their values are correct the getter methods are synchronized on the session instance. This synchronization may lead to slower execution of the getter when another thread/request does something slower in another synchronized method of Session.
> Using AtomicInteger should improve here.
> Other fields of Session like locale and style are not synchronized and different threads may read old value for them. Using AtomicReference should improve this.
> Some special boolean fields like 'dirty' and 'sessionInvalidated' should be made volatile to avoid dirty reads.
> With WICKET-5473 org.apache.wicket.Session#nextPageId() and org.apache.wicket.Session#nextSequenceValue() call #dirty() only for bound sessions. The check whether the session is bound or not should really be in #dirty() itself.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)