NetKernel News Volume 2 Issue 45

September 16th 2011

What's new this week?

Catch up on last week's news here

Repository Updates

The following updates are available in the NKEE and NKSE repositories.

  • lang-groovy 1.10.1
    • Fixed potential slow long-term memory leak on groovy compiler transreptor. This was a rare and slow potential leak that would have only been apparent in a system that never had any changes to the installed spaces. If you're using Groovy in production in a system that rarely changes then we recommend you apply this update.
  • xml-saxon 1.8.1
    • Fixed potential deadlock in XSLT transform compiler transreptor.

The Unmarked ThreadSafe Recursion Deadlock

One of the safety nets that NetKernel provides as standard is the ability to explicitly control the thread scheduling to an endpoint. In the constructor of an endpoint you can call declareThreadSafe() to mark the endpoint as safe for concurrent use.

By default all endpoints are assumed to not be thread safe. Meaning the kernel will only serially issue requests to an endpoint. This is pretty powerful, since it means that the default operating assumption of NetKernel is to be safe and not to trust unwarranted code. This can be especially important when your endpoint is using third party class libraries - I can't tell you how many frogs we've kissed only to find they were toads when it came to thread safety. Writing good, safe and efficient concurrent libraries is an art form.

So NK tries to play safe. When you're confident with your code and the library is well tested for your use case, then just call declareThreadSafe() in the endpoint constructor and NK will seamlessly switch to concurrently and optimally schedule request threads to your code.

However, as with any default constraint, there is an important consequence to be aware of. If an endpoint is not marked as thread safe it will never receive more than one request at once (duh, that's what I just said right?). The reason this is something to be aware of is that sometimes you'll want to be able to write re-entrant extrinsic recursive processes. Which is a fancy way of saying an endpoint might want to issue a sub-request that will be routed back through the address space to the same, currently executing, endpoint.

A very obvious example is something like the extrinsic Fibonacci double recursion demo. Obviously anything that is so explicitly recursive would need to be marked as thread safe so that the kernel would allow the sub-request back into the endpoint which is still handling the original request.

xml-saxon update

Mostly this pattern is fairly rare and so the default is a pretty good compromise. But today's update to xml-saxon fixes a more subtle and indirect, and potentially problematic, consequence.

NetKernel's thread safety "interlock" mechanism applies equally to all endpoints. We tend to think of just Accessors receiving requests concurrently, but of course so do Transreptors. It turned out that the (not to be named) maintainers of the xml-saxon library had left the XSLT2 compiler transreptor in its default thread safe state. It was only being used serially. Which is fine, if not optimally efficient, most of the time.

But it turns out that the NK4UM application was using XSLT2 transforms which indirectly caused the compilation of other XSLT transforms. There was an indirect circular recursion back to the transreptor. But since it wasn't marked as thread safe NK stopped sending any more requests to it. Net result an indirect deadlock.

Today's update to xml-saxon is simply a one line change to the transreptors to mark them as threadsafe - which eliminates this potential recursion deadlock.

Most of the time you'll probably never encounter this pattern - but just in case you do, always do a check when you're doing your release code sign-off to check that you've actually taken a firm decision about the thread-safety of your endpoints.

Incidentally if you ever suspect that you might have interlock deadlocks just take a look at the kernel request tool..


..which will highlight in red all the blocked requests and the pending non-thread safe endpoint they are waiting for.

Tom's Book v0.8

Here's this week's news from Tom Geudens...

The 'Practical NetKernel Book', also known as 'Hello NetKernel' and 'NetKernel in Action' is in its 8th iteration.

Chapter 5 is finished and that means Part I is also finished. Hurrah ! On top of that Joe Devon has done a complete (!) review of everything so far. The number of his corrections is enormous and so is my gratitude for his effort ! We both gained a lot of insight and as a result you should find it a much smoother read now. Thank you very much Joe. You've earned your spot on the "Thank You" page (as soon as I put it in) next to Rene Luyckx.

I plan to work my way to a 1.0. version (that's at least two Chapters finished in Part II as well as a review after the imminent NK4 update release) which should be ready by October 27th ... that's right ... together with the bootcamp in (my home) Belgium. All participants will receive a printed copy. I just might add a bottle of Belgian beer too ... who knows ;-).

You can download iteration 8 from

or if you want to follow along and have the latest 'build'

As always, your feedback and input is highly appreciated. You can send it to tom(dot)geudens(at)hush(dot)ai"

Talk OTUG: NetKernel and the Resource Oriented Computing Revolution - Minneapolis/St Paul, USA 20th September

Its a brief update this week since I'm travelling in the US. If you're in the Twin Cities area I'll be giving a presentation to the OTUG group on Tuesday. Details and venue are here.

NetKernel Europe Bootcamp - Brussels, Belgium, Thursday 27th October 2011

Sponsored by Steria Benelux
Registration is open for the NetKernel Europe Bootcamp 2011

The event takes place on Thursday 27th October.

If you want to take advantage of face-to-face opportunity we will also be around on both Wednesday 26th and Friday 28th for meetings etc.

We're looking forward to seeing you in Brussels. (As ever, it is entirely coincidental that this location is a world-renowned centre for hop-oriented beverages)

Reminder: Java 5 Support - End of Life Heads Up, October 2011

Java 5 support will reach end-of-life in October 2011. Please see the notice for details.

Please let us know if you have concerns or need assistance with planning/testing for this transition.

Have a great weekend,


Please feel free to comment on the NetKernel Forum

Follow on Twitter:

@pjr1060 for day-to-day NK/ROC updates
@netkernel for announcements
@tab1060 for the hard-core stuff

To subscribe for news and alerts

Join the NetKernel Portal to get news, announcements and extra features.

NetKernel will ROC your world

Download now
NetKernel, ROC, Resource Oriented Computing are registered trademarks of 1060 Research

© 2008-2011, 1060 Research Limited