Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Easy multi-threading in Quest3d  (Read 16557 times)
May 27, 2011, 03:39:34 pm
It is easy to get multithreading now in Q3d, everything you link to Q3dTool_MTCaller will be done in a different thread than Quest3d. This way you can do parallel-processing without affecting your Quest3d render-loop.

You may use this channel for isolated processes, not to mix with the global code. Something similar to the CallOnGetChild channel where you do a process and obtain your return value (but now, independent for the q3d main thread). For example, you could use this channel to load your objects in distance for your landscape without stalling, to load/save files, textures, complex calculations, AI, etc.

Channel doc:
Q3dTool_MTCaller (MultiThread Caller):
It is a value base-type channel which represent a locked status (0: Not Locked / 1: Locked). This value is automatically set by the channel. Call it to create a thread to execute both children "Action" and "OnActionFinished".

Children:
Action: Process to be done by the thread
OnActionFinished (optional): Link here what you want to be called by thread when that linked to Action node is finished.

Remarks:
The channel does basically create a thread which will traverse what is linked to it, independent for the Quest3d main thread.

(Compiled for the 4.3.2 version)
PD. Handle with care.

Edit:
Finally the new channel version for commercial use: http://www.q3dtools.com/Q3dTool_MTCaller.html

Attached updated channel demo version.

Attachment new channel for the Beta6.

* Q3dTool_MTCaller_DEMO.rar (2603.1 KB - downloaded 612 times.)
* Q3dTool_MTCaller_Beta6DEMO.rar (13.08 KB - downloaded 670 times.)
May 27, 2011, 04:00:15 pm
Sweet Smiley
May 27, 2011, 05:46:12 pm
This is quite a significant plugin!

I wanted to load asynchronously 3 years ago
http://forum.quest3d.com/index.php?topic=64509.0

Maybe this MT (async/worker/thread) Channel can now do what I want.

I know it's only a prototype but if it does work well it is something I could
definitely use on a regular basis!

Nice work Jorge!
May 27, 2011, 05:52:40 pm
perhaps this is of the hidden features of quest3d 5  Tongue

May 27, 2011, 05:59:54 pm
perhaps this is of the hidden features of quest3d 5  Tongue
It is done in 4.3.2.  Yummie, I offered my self as 5.0 beta-tester without success yet.

As far as I know, 5.0 is mostly focused in templates, shaders... (lumionizated version) Cheesy.
May 28, 2011, 03:23:51 am
I added this channel to my polygon reduction routines, and am able to show progress throughout the process instead of per model with the app appearing frozen between each model. Thanks so much Jorge!!!
May 28, 2011, 08:46:26 am
Im testing the channel for real-time XML generation and working with no problem Wink
Let's give it a time and if no problems found, call it stable.
May 28, 2011, 10:53:17 am
Very interesting, doubly so.

Have a project that needed just such a solution, and will start testing its use later this week.

Thanks Jorge.
May 28, 2011, 12:28:36 pm
Great job jorge. I also want to use it for my landscape. Very useful stuff.  Cheesy

ali-rahimi.net
June 03, 2011, 02:18:11 pm
To compliment this channel here is a simple "While" channel.

You can trigger Jorge's Multithread channel  to create a thread and the While channel will call it's second child continuously until the first child is <= 0 at which point the thread will close.

As a usage example I use this to do video recording in a seperate thread from frames that are captured in the main thread.

See attached .zip for channel and simple example.

* While.zip (8.42 KB - downloaded 403 times.)
June 03, 2011, 02:22:01 pm
Hi, Tom.

I made that improvement also through a channel option I called "iterative" Smiley


* Dibujo.jpg (16 KB, 442x298 - viewed 1802 times.)
June 03, 2011, 02:25:39 pm
OK, the version at the top of this thread does not have that  Clown
June 03, 2011, 02:27:25 pm
no Tongue
It is for a commercial version I am working on, for this and others channels. The commercial version also handle exceptions.
June 03, 2011, 03:11:19 pm
Cool Smiley
June 03, 2011, 06:58:47 pm
Nice  Yummie

Pages: [1] 2 3 4   Go Down
  Print  
 
Jump to: