Using the JRuby serialize ant task on some of my own code, I stumbled into
this:

  $stderr.puts "Thread 1: 1"
  s = Thread.new do
    $stderr.puts "Thread 2: 1"
    sleep(5)
    $stderr.puts "Thread 2: 2"
  end
  $stderr.puts "Thread 1: 2"
  sleep(5)

Running this w/o serialize gives:

Thread 1: 1
Thread 2: 1
Thread 1: 2
Thread 2: 2

As expected, but when this is serialized, I get:

Thread 1: 1
Thread 2: 1
[sleeping]
Thread 2: 2

It looks as if serialized code implies single-threading, is this by
design?  Is there any way around it?

Evan




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to