[concurrency-interest] java fork-join getting-started notes for beginners <-> Java 7

Dan Grossman djg at cs.washington.edu
Tue Aug 16 18:00:31 EDT 2011


Short version:

I'm looking for quick confirmation that using the fork-join framework
with the Java 7 JRE is just as easy as it seems and that I'm pointing
students to the right stable versions of things.

Long version:

Background:

As I've mentioned on this list a couple times, I've developed a
course-unit for second-year undergraduates that introduces parallelism
and concurrency using Java and the Fork-Join Framework (though it's
not really that Java-specific).  At Washington, we've used this unit
in our required data-structures course for 1.5 years now and it's been
picked up by 5 other schools so far.  In all, 10 instructors, most
non-experts in Java, parallelism, or both have used it and they all
claim success and, "I will do this again."  For more information,
http://www.cs.washington.edu/homes/djg/teachingMaterials/spac/

One thing that has proven absolutely essential is step-by-step
instructions suitable for beginners, specialized to just what they
need: ForkJoinPool, RecursiveTask, RecursiveAction.  This was
particularly important for Java 1.6.  The url
http://www.cs.washington.edu/homes/djg/teachingMaterials/spac/grossmanSPAC_forkJoinFramework.html
has these instructions and was last updated a few months ago.  For
those of you who have not taught undergraduates, let me assure you
that there are, nonetheless, a mind-boggling number of ways to enter
-Xbootclasspath/p:jsr166.jar incorrectly. :-)

So what now:

It seems time to update my step-by-step instructions to say:
  1. Please use Java 7 following steps a, b, c.
  2. If you really can't, then here are the more complicated steps for
using Java 6 following steps, d, e, f, g.

In preparation for this, I downloaded JDK 7 onto a [Windows 7, 64-bit]
machine that has never had Java on it, installed Eclipse IDE for Java
Developers, indigo release (my instructions prefer but don't mandate
eclipse), set the Java Project JRE to JavaSE-1.7, and ran the attached
file.  It Just Worked.  This is So Wonderful and I send my heartfelt
appreciation to everyone on this list who helped make it happen.

Now my questions -- I think the answers are all 'yes' but this is the
place to confirm and I'm most concerned about (C):

A. Java 7: Is this the real deal -- the framework will use the
available processors and, after suitable VM warmup, be the parallel
execution engine we expect?

B. Installation: Will upgrading on machines that already have Java 6
be just as seamless?

C. Code: Is the attached file the way to show things to beginners?
(Note: My point is to show them the reduction explicitly rather than
using a library method.  This is for pedagogical purposes.  So no
complaining about that.)

D. Eclipse: When choosing JavaSE1-1.7, Eclipse Indigo release warns,
"The 1.7 compiler compliance level
   is not yet supported.  The new project will use a project specific
compiler compliance level of 1.6".  Am I correct that this can be
ignored since I'm not using any new /language/ features, just a new
/library/? (Note: My understanding is there are Eclipse versions
available with 1.7 compilers, but if we're okay with the most standard
most stable Eclipse release, this is extremely helpful.)

E: Anything else I can do to make this as bullet-proof for beginners
as possible?

Thanks!

--Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SumTest.java
Type: application/octet-stream
Size: 1349 bytes
Desc: not available
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20110816/3b1616bf/attachment.obj>


More information about the Concurrency-interest mailing list