Multi-thread building

About Monkey 2 Forums Monkey 2 Development Multi-thread building

This topic contains 6 replies, has 4 voices, and was last updated by  codifies 2 years, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6553

    nerobot
    Participant

    Mx2cc use a single core. Will be nice to use 2+ cores for (re)building modules.

    I tried to use two .bat files with different modules list inside of them.

    But got error – file is busy by another process. I didn’t try to use other instance of mx2cc…

    Just an idea, but maybe it’s simple to implement.

    #6565

    codifies
    Participant

    you hit probably the main reason its not multi threaded, any attempt at this will need to understand module dependency and probably work from the bottom of the hierarchy level at a time

    #6567

    nerobot
    Participant

    I know that. And it don’t sounds like impossible. 🙂

    #6568

    scurty
    Participant

    Might be a terrible way of handling this but, one solution would be to start a single mx2cc process for a certain collection of modules/apps then create another mx2cc process for another collection of code simultaneously…

    For example:

    Maybe you could call these on new Fiber:
    mx2cc makemods libc stb-image stb-vorbis
    mx2cc makemods std miniz
    mx2cc makemods <module> <module> <module> etc…

    #6569

    codifies
    Participant

    This would certainly be do-able for the “default” modules that come with monkey, just in a manual script

    I better way would probably be just to peek in each modules main file for #includes with <> – I’m not sure of the accuracy of depends in module.json…. (ya could put owt in there!)

    To be honest I think they should just get built as they are needed when different projects are compiled…

    #6593

    Richard Betson
    Participant

    I would like to see multi-threading in Monkey 2, beyond building (as I understand it no thread support currently). If you are going for a larger more complex gaming project threading is a sort of must have, especially on mobile where distributing the compute load is essential. I’m not sure what Mark has planned for Vulkan support, but does it require the Monkey 2 API to support multi-threading?

    Perhaps this is a good topic for another Patreon goal say after the 3D module is done.

    #6598

    codifies
    Participant

    +1 multi threading is *very* handy, that said I wouldn’t fancy the task of writing and debugging a multi threaded GC, unless you have a “separate” GC for each thread, any communicating between threads whether the main “application” thread or other threads will take care, a definite challenge but yeah worth it especially as even mobile processors quite commonly have 2-4 cores (not counting the low power cores!)

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.