View Full Version : Multi-threading with AutoPlay Media Studio?
Sakuya
03-11-2010, 04:10 PM
I've tried to put HTTP.Download into a coroutine, run it and then attempt to click another button opening a Dialog.Message.
Unfortunately, this didn't work and I had to wait for the download to finish before my Dialog came up.
Has anyone else tried any multithreading with AutoPlay Media Studio? I've only tried HTTP.Download, but maybe some others will work.
RizlaUK
03-11-2010, 04:55 PM
when i need background work done in AMS i always resort to PB, wrap the function in a thread, return the thread id back to AMS and send callback messages back to AMS via the memory plugin, when the thread has finished i make AMS clean up, the only restriction is a single argument can be passed to a thread, but thats overcome by sending a pointer to a structure containing the arguments
its tricky, but powerful and worth the headache it causes, when i find time i'll turn some of this stuff into plugins
jassing
03-11-2010, 08:23 PM
coroutines in LUA are not automatic, you need to manually start/pause/stop or complete them. IOW -- YOU are in charge of the time slicing between the main app and your co-routine.
RizlaUK
03-12-2010, 03:31 AM
i did mess with coroutines once, had the same luck as Sakuya, if anyone has a working example it would help quite a lot of people :yes
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.