« MBS Xojo / Real Studi… | Home | FileMaker Conferences… »

Doing hash or encryption on several CPUs in Xojo

One of the great things we can do safely in plugins is to put work in extra preemptive threads. This way your GUI in Xojo stays running responsive while you keep all CPUs in a computer busy. This works by calling the plugin method in a Xojo thread. Now the plugin starts processing on a preemptive thread which can run on another CPU. The plugin function on the xojo thread yields time, so your other xojo threads can do their work. Now in total with 8 xojo threads doing work, you can get 8 CPUs at nearly 100% usage each. And that with a total number of 17 threads running: Your main thread, 8 Xojo threads and 8 threads run by plugin.

Now we recently added functions CipherMBS.ProcessFile, DigestMBS.ProcessFile, MD5DigestMBS.HashFile, SHA1MBS.HashFile, SHA256MBS.HashFile and SHA512MBS.HashFile to process encryption or hashing in background. If you schedule threads correctly, you get the full speed up until hard disk is the bottleneck.
28 05 14 - 23:46