how to do task-level parallelism in Windows?

Discussion in 'Ruby' started by Zd Yu, May 11, 2011.

  1. Zd Yu

    Zd Yu Guest

    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?
     
    Zd Yu, May 11, 2011
    #1
    1. Advertisements

  2. Is jruby acceptable? Jruby threads do make use of multiple processors.
     
    Joel VanderWerf, May 11, 2011
    #2
    1. Advertisements

  3. Zd Yu

    Zd Yu Guest

    Joel VanderWerf wrote in post #997899:
    I need to use win32ole. I am afraid JRuby cannot do this.
     
    Zd Yu, May 11, 2011
    #3
  4. There is a jruby-win32ole gem -- I haven't used it, but it sounds like
    it may do what you want.
     
    Christopher Dicely, May 11, 2011
    #4
  5. Zd Yu

    Zd Yu Guest

    Christopher Dicely wrote in post #997903:
    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.
     
    Zd Yu, May 11, 2011
    #5
  6. Yes, ge ridden of windows.

     
    Marcio Carneiro, May 12, 2011
    #6
  7. 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
     
    Charles Oliver Nutter, May 15, 2011
    #7
  8. Zd Yu

    Zd Yu Guest

    Zd Yu, May 16, 2011
    #8
  9. Charles Oliver Nutter, May 17, 2011
    #9
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.