Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Inner workings of LSL

Madox Kobayashi
Madox Labs R&D
Join date: 28 Jun 2003
Posts: 402
08-21-2003 08:08
This is what I have deduced about LSL so far, using various debugging techniques. See what you all think and maybe a Linden can comment.

Seems that:

The script engine operates with 250ms time slices. Every time slice, your script gets a certain amount of time to do its thing. It doesnt get the whole 250ms, but a peice of it.

When your time is finished, your script has to wait until the next time slice comes around. So if you only got 50ms out of the 250, you might have to wait 200ms until your script gets time again.

This jives with things I have seen like llSetStatus() not actaully taking effect until 250ms later. If you print the time, the smallest increment that you will see is 250ms.

So questions:

If there is a single script running - will it get all the 250ms?
If there is two scripts running, will they get 50% of the time each?
Will two scripts on the same object run concurantly or one after another?
Is there some value in the status window that shows how much of the 250ms each script will be getting?

I'll be looking into these in the future.
_____________________
Madox Kobayashi

Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
08-21-2003 11:42
From what I have observed, different scripts on the same object appear to get separate timeslices (i.e. what one does doesn't block the others) and they definitely get separate memory heaps.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
08-23-2003 15:11
Hah, you people are spoiled. I am happy to get a 500ms ping.
God damn transatlantic lag :D
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
08-23-2003 17:12
Accroding to something I read somewhere (very specific, I know) I recall reading that "each script is single threaded."

This would indicate to me that each script runs in its own thread, and due to the nature of threads, each thread gets roughly the same timeslice.

I would also postulate that the length of the timeslice is not fixed, and if there is a fixed amount of time that a script runs in "bursts", it's programmed into the sim.

The length/interval of a timeslice should be dependent on how many scripts are running on the sim.
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
08-24-2003 01:40
Scripts are not guaranteed time: they are throttled if the machine load gets too high. The voting station at last night's Mann Chinese opening took upwards of 10 seconds to go from red to green at one point.