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.
- 
		AuthorPosts
 - 
		
			
				
January 16, 2017 at 6:04 am #6553
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.
January 16, 2017 at 9:41 am #6565you 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
January 16, 2017 at 11:53 am #6567I know that. And it don’t sounds like impossible.
January 16, 2017 at 12:57 pm #6568Might 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…January 16, 2017 at 4:54 pm #6569This 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…
January 17, 2017 at 9:32 pm #6593I 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.
January 17, 2017 at 10:49 pm #6598+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!)
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.