sketchucation logo sketchucation
    • Login
    ๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Can Ruby use multicore?

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 5 Posters 1.2k Views 5 Watching
    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

      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

        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

          @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
          • tbdT Offline
            tbd
            last edited by

            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

              @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
              • Chris FullmerC Offline
                Chris Fullmer
                last edited by

                @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

                  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
                  • tbdT Offline
                    tbd
                    last edited by

                    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
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement