how to do task-level parallelism in Windows?

Z

Zd Yu

I want to achieve better performance through parallelism. The
thread-level parallelism is not an option, because it is not *really*
parallel.

In Linux, kernel.fork makes it easy to achieve task level parallelism.

In windows, kernel.spawn seems to be the most closed equivalent.
However, it requires to specify the ruby.exe location and script
location explicitly, which may be not available at runtime.

Is there a better way to achieve task level parallelism in Windows?
 
J

Joel VanderWerf

I want to achieve better performance through parallelism. The
thread-level parallelism is not an option, because it is not *really*
parallel.

Is jruby acceptable? Jruby threads do make use of multiple processors.
 
Z

Zd Yu

Joel VanderWerf wrote in post #997899:
Is jruby acceptable? Jruby threads do make use of multiple processors.

I need to use win32ole. I am afraid JRuby cannot do this.
 
C

Christopher Dicely

Joel VanderWerf wrote in post #997899:

I need to use win32ole. I am afraid JRuby cannot do this.

There is a jruby-win32ole gem -- I haven't used it, but it sounds like
it may do what you want.
 
Z

Zd Yu

Christopher Dicely wrote in post #997903:
There is a jruby-win32ole gem -- I haven't used it, but it sounds like
it may do what you want.

I just tried it. It seems there are some compatible problems. My code
does not work with JRuby + jruby-win32ole, although it works well with
ruby + win32ole.

The error looks like:
=====================
Dispatch.java:-2:in `invokev': org.racob.com.ComFailException: Invoke
of: Find
Source:
Description:

from Dispatch.java:243:in `invokev'
from Dispatch.java:187:in `callN'
from RubyWIN32OLE.java:203:in `invokeMethodOrGet'
from RubyWIN32OLE.java:112:in `method_missing'
from RubyWIN32OLE$i$0$0$method_missing.gen:65535:in `call'
from JavaMethod.java:642:in `call'
from RuntimeHelpers.java:497:in `call'
from CachingCallSite.java:345:in `callMethodMissing'
from CachingCallSite.java:249:in `cacheAndCall'
from CachingCallSite.java:71:in `call'
from C:\my_tool.rb:1362:in `method__98$RUBY$find'


my code: (Excel manipulation)
==========
keys = @workbook.Worksheets("sheet name").Range( "A1" ).EntireRow

current = keys.Find( value,
nil,
WIN32OLE::XlValues,
WIN32OLE::XlPart,
WIN32OLE::XlByColumns,
WIN32OLE::XlNext,
false,
false,
false )


==================
it seems the 'Find' method cannot be invoked.
 
C

Charles Oliver Nutter

I just tried it. It seems there are some compatible problems. My code
does not work with JRuby + jruby-win32ole, although it works well with
ruby + win32ole.

Please report this bug at http://bugs.jruby.org. We intend for
jruby-win32ole to be 100% compatible with MRI win32ole, and we would
like to fix this. Thank you!

- Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top