• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Can Ruby use multicore?

Scheduled Pinned Locked Moved Developers' Forum
8 Posts 5 Posters 1.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    NewOne
    last edited by 24 Sept 2009, 05:43

    I don't understand much of this, but it seems that we can benefit of multithreading with ruby scripts. http://phrogz.net/ProgrammingRuby/tut_threads.html
    If true, than several plugins could be enhanced to do their job much faster. As I said, I'm not so skilled in ruby 😳 , so maybe someone more skilled will take a look and say if it it possible to use multithreading or not.

    good day and I hope it wasn't just a false alarm...

    1 Reply Last reply Reply Quote 0
    • R Offline
      remus
      last edited by 24 Sept 2009, 09:16

      I dont know the details of it myself, but im pretty sure you cant use threads properly in SU ruby. Might be worth asking TBD about it, as i seem to remember him explaining it at some point.

      http://remusrendering.wordpress.com/

      1 Reply Last reply Reply Quote 0
      • N Offline
        NewOne
        last edited by 24 Sept 2009, 09:29

        @remus said:

        I dont know the details of it myself, but im pretty sure you cant use threads properly in SU ruby. Might be worth asking TBD about it, as i seem to remember him explaining it at some point.

        I remember also a discussion about forcing sketchup to use multiple cores by using ruby, but the answer was NO, it can not be possible. What I'm wondering is if ruby plugins could benefit of multiple cores, by themselves? Because some plugins perform complex operations and can take very long time to finish their job.

        1 Reply Last reply Reply Quote 0
        • T Offline
          tbd
          last edited by 24 Sept 2009, 11:31

          it is not possible as Ruby has a Global Interpreter Lock - check concurrency-is-a-myth-in-ruby and multi thread scaling issues with python and ruby.html for an explanation

          in short: no, as Ruby uses just 1 native OS thread so you cannot have multi core processing, you just have parallelism using Ruby thread - good for some things but it will not make your code faster.

          @newone said:

          some plugins perform complex operations and can take very long time to finish their job.

          split the code and do the calculations in an extension using native threads

          SketchUp Ruby Consultant | Podium 1.x developer
          http://plugins.ro

          1 Reply Last reply Reply Quote 0
          • N Offline
            notareal
            last edited by 24 Sept 2009, 12:03

            @unknownuser said:

            split the code and do the calculations in an extension using native threads

            Agree, far more efficient way.

            Welcome to try [Thea Render](http://www.thearender.com/), Thea support | [kerkythea.net](http://www.kerkythea.net/) -team member

            1 Reply Last reply Reply Quote 0
            • C Offline
              Chris Fullmer
              last edited by 24 Sept 2009, 17:39

              @notareal said:

              @unknownuser said:

              split the code and do the calculations in an extension using native threads

              Agree, far more efficient way.

              If only I undersstood what it meant..... 😕

              Chris

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • R Offline
                remus
                last edited by 24 Sept 2009, 22:07

                i think theyre talking about writing your program to run outside SU on native, proper threads then getting it to talk to SU.

                http://remusrendering.wordpress.com/

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tbd
                  last edited by 24 Sept 2009, 22:27

                  extension = code in another language brought in Ruby world. for example, my dezip is an extension that brings unzip capabilities to SU Ruby

                  the egg and chicken problem - SU is an extension to Ruby 😮

                  SketchUp Ruby Consultant | Podium 1.x developer
                  http://plugins.ro

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    1/8
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement