Multithreading

Using function yyc_run_in_thread you can run functions in a separate thread. This is handy for example when you need to do a heavy computation without freezing the game. Mutexes and semaphores are available too!

/// @desc Create event
yyc_run_in_thread(function () {
    while (true)
    {
        show_debug_message("This does not block the main thread!");
    }
});

See YYC_Task and YYC_GroupTask if you would like to utilize threads to run tasks.

Known limitations

Following is a list of GM features that are known to not work when run in a separate thread:

  • Rendering to surfaces

Have you found some more? Please, let me know!

Do you find this page helpful?

Copyright © 2021, Patrik Kraif. Built on October 14, 2021 using GMDoc.