[sldev] Bidding System Algorithm for Allocation Script Memory

Tigro Spottystripes tigrospottystripes at gmail.com
Sat Dec 19 16:43:47 PST 2009


Would it be too hard to instead of true stasis the scripts were just
transfered into a separated thread that has less priority, runs only
when the is some idle time on the processor or somthing (including using
cheaper hardware and nto getting in the way of other stuff),  so scripts
can continue to work? (either way the event that gets triggered when a
script is about to get downgraded would still be great to have)

Carlo Wood escreveu:
> There are two problems to be solved:
>
> 1) Which script to put "in stasis" (I like that expression)
> 2) What do with scripts that run and then have to stop.
>
> The answer to 2 being "put them in statis".
>
> Your bidding system could be solved with a simple priority queue
> I'd think... I don't think that "bidding" is a good word for it,
> but the idea to make the priorities equal to inverse of the percentage
> used of their "rightful" share should work indeed.
>
> On Sat, Dec 19, 2009 at 07:06:57PM -0500, Darrius Gothly wrote:
>   
>> Suggestion: A "Bidding System" for allocating memory resources on a Sim.
>>
>> When a script attempts to load and needs to allocate a chunk of memory, it 
>> places a "bid" for that amount of memory. If the amount it needs is freely 
>> available, the bid is filled and the script runs as expected.
>>
>> However, if the amount of memory is not freely available (meaning the Sim is 
>> currently at max for script memory), this forces an "Auction". All scripts 
>> currently on the Sim must place a bid for the amount of memory requested. 
>> The "price" of their bid is calculated based on their current parcel's 
>> memory usage relative to its maximum usage (expressed as a percentage such 
>> that a maxxed out parcel would return 0%, a totally unused parcel would 
>> return 100%, and an overlimit parcel would return a negative percentage) and 
>> the size of their parcel in sqm. I'm sure there's some multiplier there that 
>> would assure even small parcels that have used virtually none of their 
>> resources always bid a higher price than other parcels that are near their 
>> limit.
>>
>> In this system, even Avatar attachment scripts would "bid" accordingly. 
>> There could be an additional multiplier applied to the Avatar's bid price to 
>> assure they get slightly higher advantage in the auction though.
>>
>> After all, Sims tend to be pretty static with respect to how many scripts 
>> are running .. when you count only the scripts in objects on the Sim. When 
>> you toss in the variable of Avatars and their attachments, that's when 
>> things start varying wildly.
>>
>> The last issue is .. what happens to the "losers" in the auction? My best 
>> suggestion is they get "checkpointed" .. swapped out and put in stasis until 
>> such time as they can win another auction. As memory is released (like when 
>> an Avatar leaves a Sim) the memory freed up could be placed at auction, and 
>> only checkpointed scripts allowed to bid. 
>>
>>
>> _______________________________________________
>> Policies and (un)subscribe information available here:
>> http://wiki.secondlife.com/wiki/SLDev
>> Please read the policies before posting to keep unmoderated posting privileges
>>     
>
>   



More information about the SLDev mailing list