Multithreaded plugin functions can increase speed of Xojo application

  1. 7 weeks ago

    Christian S

    Feb 13 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany
    Edited 7 weeks ago

    Have you seen the "NSImageMBS multithreading " or "Threaded Encryption and Hashes " example projects in Xojo?

    -image-

    Do you notice that with 4 Xojo threads, the plugin can actually get 4 CPU cores busy and get work done faster?

    Over the last releases we added quite a few MT methods. Those are plugin methods which perform work on a preemptive thread. The Xojo thread calling them yields CPU time to other threads while it waits for the preemptive thread to finish work. And if you use several threads in Xojo already, this will help you keep more CPU cores busy.

    Here a list of all MT methods:

    In general there are two types here. A method like CIImageMBS .imageWithDataMT may be used in several threads to get CPU cores busy and process a lot of images. Other functions like sharedAddressbookMT are just helping to avoid the GUI to stand still while a dialog is asking the user for permissions.

    If you have ideas for other methods which could benefit from loading work off to another CPU core, please don't hesitate to contact us.

  2. Beatrix W

    Feb 13 Pre-Release Testers, Third Party Store Europe (Germany)

    It's quite cool to see RegexMBS in the list. I'm going to test. Is there any overhead to using the MT functions?

  3. Christian S

    Feb 13 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    There may be the need to create a thread, so only do it, if you need GUI responsive and expect the operation to take more then .5 seconds.

  4. Beatrix W

    Feb 13 Pre-Release Testers, Third Party Store Europe (Germany)

    My main code is threaded anyways. But I have large strings for the Regex.

or Sign Up to reply!