... Software for the people!
Become a member of Tropical Technologies Community, right now!
Search
Main Menu
Login
Username:

Password:

remember me

Lost Password?

Register now!
Recent Downloads
Shell Object Edito...
(Software, Mon, 18-May-2009)
TimeCube
(Software, Sat, 15-Nov-2008)
SciTE 1.76 plus Sh...
(Software, Sat, 05-Apr-2008)
Hotkey Plugin SDK
(QCD Plugins, Sun, 29-Oct-2006)
Hotkey Plugin
(QCD Plugins, Sun, 29-Oct-2006)
Transparent Image
(Samurize, Sat, 13-May-2006)
Lua Script (beta 6...
(Samurize, Fri, 03-Mar-2006)
Samurize Universal...
(Samurize, Tue, 24-Jan-2006)
Line Input Plugin
(QCD Plugins, Sun, 08-Jan-2006)
Custom Progress
(Samurize, Sun, 13-Mar-2005)
Multithreading Support
Submitter: Tropics Date: 2006/3/4 0:53 Views: 353 Rate: 0.00/2
Summary: The lua script plugin supports multithreading. Essentially that means it can run in the background without disturbing the samurize client it is running in. Using this feature is extremely simple.

Introduction
Usually, when a plugin function is called from the samurize client, samurize waits for the result to be available. This is also true for the scripts supported in samurize like vbs or javascript. The multithreading feature of the lua script plugin allows you to get around that limitation.

Using that feature is very simple. By default, a script behaves like it would with other scripting languages. The script is loaded and run, and the result of the script (identified by the return statement) is returned to samurize for display.

The clou to multithreaded functionality is this function:
SetIntermediateResult( [TempResult] )

The TempResult parameter is optional, if you don't set it the last intermediate result will be used.
You have to enable the Threads & Processes Module in the configuration dialog to use this function.

When you call this function, the intermediate result you give as the TempResult parameter will be given to samurize and samurize will use it. The script will continue to run in the background. You can update the intermediate result using the same function whenever you want. The script finishes as soon as the return statement is reached and the samurize client will return that value.
Subtitles
  1. Introduction
  2. Example
Pages: (1) 2 »
URL: http://www.tropictech.de/modules/article/view.article.php?c1/12
Rate
10987654321