You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Sahoo (JIRA)" <ji...@apache.org> on 2012/06/14 16:53:42 UTC

[jira] [Created] (FELIX-3553) Use of parallel class loading capability of JDK7

Sahoo created FELIX-3553:
----------------------------

             Summary: Use of parallel class loading capability of JDK7
                 Key: FELIX-3553
                 URL: https://issues.apache.org/jira/browse/FELIX-3553
             Project: Felix
          Issue Type: Improvement
          Components: Framework
            Reporter: Sahoo


Is there any plan to make use of this feature [1] in Felix?

[1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen edited comment on FELIX-3553 at 11/30/12 8:52 AM:
-----------------------------------------------------------------

Ah, right. I made an assumption that it was not recursive on the same class loader. Maybe the logic could be changed to something like this:

      synchronized (m_classLocks) {
                        Thread me = Thread.currentThread();
                        while (m_classLocks.containsKey(name) && m_classLocks.get(name) != me) {
                            try {
                                m_classLocks.wait();
                            } catch (InterruptedException e) {
                                // TODO: WHAT TO DO HERE?
                            }
                        }
                        // Lock released, try loading class
                        clazz = findLoadedClass(name);
                        if (clazz == null) {
                            // Not found, we should try load it
                            m_classLocks.put(name, me);
                        }

Here I assume its ok to call findLoadedClass recursively though. Regarding the InterruptedException, I'm not sure how to handle it other than rethrow as runtimeexception.

Good point regarding java 7. I can try make it work with older jvms. Not sure how to test it properly though. Compile on java7 and run on java6? I'll add the recursive locking and attach a new patch. Thanks.
                        
                
      was (Author: lulf):
    Ah, right. I made an assumption that it was not recursive on the same class loader. Maybe the logic could be changed to something like this:

      synchronized (m_classLocks) {
                        Thread me = Thread.currentThread();
                        while (m_classLocks.containsKey(name) && m_classLocks.get(name) != me) {
                            try {
                                m_classLocks.wait();
                            } catch (InterruptedException e) {
                                // TODO: WHAT TO DO HERE?
                            }
                        }
                        // Lock released, try loading class
                        clazz = findLoadedClass(name);
                        if (clazz == null) {
                            // Not found, we should try load it
                            m_classLocks.put(name, me);
                        }

Here I assume its ok to call findLoadedClass recursively though. Regarding the InterruptedException, I'm not sure how to handle it other than rethrow as runtimeexception.

Good point regarding java 7. I will try to rework it to work with older jvms and add the recursive locking and attach a new patch. Thanks.
                        
                  
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13505209#comment-13505209 ] 

Richard S. Hall commented on FELIX-3553:
----------------------------------------

I will try to look at it, but it would definitely be better to make the patch against trunk. Thanks.
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classloading.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507079#comment-13507079 ] 

Richard S. Hall commented on FELIX-3553:
----------------------------------------

Your locking approach doesn't allow the thread to re-enter, not sure if this is an issue or not, but in my locking approach I mapped the class name to a thread so I could allow it to re-enter.

Also, you make all of the class loaders Java 7 class loaders, which is not what we want since the whole point of the different class loaders is to support older JVMs. So, I think we need to catch an exception in the static initializer of both class loaders so we won't fail on older JVMs, no?
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Richard S. Hall updated FELIX-3553:
-----------------------------------

    Attachment: FELIX-3553.txt
    
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen updated FELIX-3553:
----------------------------------

    Attachment:     (was: felix_parallel_classloading.patch)
    
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295084#comment-13295084 ] 

Richard S. Hall commented on FELIX-3553:
----------------------------------------

We've thought about it, but have no definitive plans.
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Richard S. Hall updated FELIX-3553:
-----------------------------------

    Fix Version/s: framework-4.2.0
    
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Richard S. Hall updated FELIX-3553:
-----------------------------------

    Attachment:     (was: FELIX-3553.txt)
    
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen updated FELIX-3553:
----------------------------------

    Attachment: felix_parallel_classload.patch

Full patch containing both lock and staticifying
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen edited comment on FELIX-3553 at 11/30/12 8:31 AM:
-----------------------------------------------------------------

Ah, right. I made an assumption that it was not recursive on the same class loader. Maybe the logic could be changed to something like this:

      synchronized (m_classLocks) {
                        Thread me = Thread.currentThread();
                        while (m_classLocks.containsKey(name) && m_classLocks.get(name) != me) {
                            try {
                                m_classLocks.wait();
                            } catch (InterruptedException e) {
                                // TODO: WHAT TO DO HERE?
                            }
                        }
                        // Lock released, try loading class
                        clazz = findLoadedClass(name);
                        if (clazz == null) {
                            // Not found, we should try load it
                            m_classLocks.put(name, me);
                        }

Here I assume its ok to call findLoadedClass recursively though. Regarding the InterruptedException, I'm not sure how to handle it other than rethrow as runtimeexception.

Good point regarding java 7. I will try to rework it to work with older jvms and add the recursive locking and attach a new patch. Thanks.
                        
                
      was (Author: lulf):
    Ah, right. I made an assumption that it was not recursive on the same class loader. Maybe the logic could be changed to something like this:

      synchronized (m_classLocks) {
                        Thread me = Thread.currentThread();
                        while (m_classLocks.get(name) != me) {
                            try {
                                m_classLocks.wait();
                            } catch (InterruptedException e) {
                                // TODO: WHAT TO DO HERE?
                            }
                        }
                        // Lock released, try loading class
                        clazz = findLoadedClass(name);
                        if (clazz == null) {
                            // Not found, we should try load it
                            m_classLocks.put(name, me);
                        }

Here I assume its ok to call findLoadedClass recursively though. Regarding the InterruptedException, I'm not sure how to handle it other than rethrow as runtimeexception.

Good point regarding java 7. I will try to rework it to work with older jvms and add the recursive locking and attach a new patch. Thanks.
                        
                  
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen commented on FELIX-3553:
---------------------------------------

I made a similar patch against 4.0.3 that we are testing out now tries to improve the attached patch(new patch attached):

- Properly signal that lock was removed from map using notifyAll
- Replaces the map with a set, and simplify/fix logic in the check. I think its a bit easier to understand at least.

It also:
- Adds registerAsParallelCapable
- Makes bundleclassloader and bundleclassloader5 static (I just used intellij's 'make static' to get this done)

Still unresolved:
- Handling interruptedexception.

Let me know if you can review it, or if I should try produce a patch against trunk. Btw, if you have any stress tests that can easily reproduce the deadlock issues, that would also be very helpful.

Thanks
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classloading.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen edited comment on FELIX-3553 at 11/27/12 3:55 PM:
-----------------------------------------------------------------

I made a similar patch against 4.0.3 that we are testing out now, that tries to improve the attached patch(new patch attached):

- Properly signal that lock was removed from map using notifyAll
- Replaces the map with a set, and simplify/fix logic in the check. I think its a bit easier to understand at least.

It also:
- Adds registerAsParallelCapable
- Makes bundleclassloader and bundleclassloader5 static (I just used intellij's 'make static' to get this done)

Still unresolved:
- Handling interruptedexception.

Let me know if you can review it, or if I should try produce a patch against trunk. Btw, if you have any stress tests that can easily reproduce the deadlock issues, that would also be very helpful. We are able to reproduce it, but it requires a lot of effort in terms of patching our system.

Thanks
                
      was (Author: lulf):
    I made a similar patch against 4.0.3 that we are testing out now, that tries to improve the attached patch(new patch attached):

- Properly signal that lock was removed from map using notifyAll
- Replaces the map with a set, and simplify/fix logic in the check. I think its a bit easier to understand at least.

It also:
- Adds registerAsParallelCapable
- Makes bundleclassloader and bundleclassloader5 static (I just used intellij's 'make static' to get this done)

Still unresolved:
- Handling interruptedexception.

Let me know if you can review it, or if I should try produce a patch against trunk. Btw, if you have any stress tests that can easily reproduce the deadlock issues, that would also be very helpful.

Thanks
                  
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classloading.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen edited comment on FELIX-3553 at 11/27/12 3:54 PM:
-----------------------------------------------------------------

I made a similar patch against 4.0.3 that we are testing out now, that tries to improve the attached patch(new patch attached):

- Properly signal that lock was removed from map using notifyAll
- Replaces the map with a set, and simplify/fix logic in the check. I think its a bit easier to understand at least.

It also:
- Adds registerAsParallelCapable
- Makes bundleclassloader and bundleclassloader5 static (I just used intellij's 'make static' to get this done)

Still unresolved:
- Handling interruptedexception.

Let me know if you can review it, or if I should try produce a patch against trunk. Btw, if you have any stress tests that can easily reproduce the deadlock issues, that would also be very helpful.

Thanks
                
      was (Author: lulf):
    I made a similar patch against 4.0.3 that we are testing out now tries to improve the attached patch(new patch attached):

- Properly signal that lock was removed from map using notifyAll
- Replaces the map with a set, and simplify/fix logic in the check. I think its a bit easier to understand at least.

It also:
- Adds registerAsParallelCapable
- Makes bundleclassloader and bundleclassloader5 static (I just used intellij's 'make static' to get this done)

Still unresolved:
- Handling interruptedexception.

Let me know if you can review it, or if I should try produce a patch against trunk. Btw, if you have any stress tests that can easily reproduce the deadlock issues, that would also be very helpful.

Thanks
                  
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classloading.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen commented on FELIX-3553:
---------------------------------------

Both of the last patches are against trunk.
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen updated FELIX-3553:
----------------------------------

    Attachment: felix_parallel_classloading.patch
    
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classloading.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (FELIX-3553) Use of parallel class loading capability of JDK7

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507079#comment-13507079 ] 

Richard S. Hall edited comment on FELIX-3553 at 11/30/12 4:10 AM:
------------------------------------------------------------------

Your locking approach doesn't allow the thread to re-enter, not sure if this is an issue or not, but in my locking approach I mapped the class name to a thread so I could allow it to re-enter.

Also, you make all of the class loaders Java 7 class loaders, which is not what we want since the whole point of the different class loaders is to support older JVMs. So, I think we need to catch an exception in the static initializer of both class loaders so we won't fail on older JVMs, no?

I should add, otherwise, this is looking pretty good. Thanks.
                
      was (Author: rickhall):
    Your locking approach doesn't allow the thread to re-enter, not sure if this is an issue or not, but in my locking approach I mapped the class name to a thread so I could allow it to re-enter.

Also, you make all of the class loaders Java 7 class loaders, which is not what we want since the whole point of the different class loaders is to support older JVMs. So, I think we need to catch an exception in the static initializer of both class loaders so we won't fail on older JVMs, no?
                  
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen updated FELIX-3553:
----------------------------------

    Attachment: felix_parallel_classload_lock.patch

Patch containing perclass locking
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

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

Ulf Lilleengen commented on FELIX-3553:
---------------------------------------

Ah, right. I made an assumption that it was not recursive on the same class loader. Maybe the logic could be changed to something like this:

      synchronized (m_classLocks) {
                        Thread me = Thread.currentThread();
                        while (m_classLocks.get(name) != me) {
                            try {
                                m_classLocks.wait();
                            } catch (InterruptedException e) {
                                // TODO: WHAT TO DO HERE?
                            }
                        }
                        // Lock released, try loading class
                        clazz = findLoadedClass(name);
                        if (clazz == null) {
                            // Not found, we should try load it
                            m_classLocks.put(name, me);
                        }

Here I assume its ok to call findLoadedClass recursively though. Regarding the InterruptedException, I'm not sure how to handle it other than rethrow as runtimeexception.

Good point regarding java 7. I will try to rework it to work with older jvms and add the recursive locking and attach a new patch. Thanks.
                        
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt, felix_parallel_classload_lock.patch, felix_parallel_classload.patch
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3553) Use of parallel class loading capability of JDK7

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400062#comment-13400062 ] 

Richard S. Hall commented on FELIX-3553:
----------------------------------------

The attached patch moves locking from the class loader object to a locking approach based on class name and thread. Need to introduce a class loader that registers as parallel capable, which is a little tricky since it must be done in a static block and our class loaders are inner classes. Need to think about it.
                
> Use of parallel class loading capability of JDK7
> ------------------------------------------------
>
>                 Key: FELIX-3553
>                 URL: https://issues.apache.org/jira/browse/FELIX-3553
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Sahoo
>             Fix For: framework-4.2.0
>
>         Attachments: FELIX-3553.txt
>
>
> Is there any plan to make use of this feature [1] in Felix?
> [1] http://download.java.net/jdk7/archive/b124/docs/technotes/guides/lang/cl-mt.html 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira