Second Life is a large, on-line virtual world where avatars dance, fly, shop, play, meet, work, fall in love and hack.
This giant, collaborative development environment is run on a grid of over 25,000 cores that simulate the land of Second Life. Since August 2008 Mono has been available as a scripting engine for running interactive content in Second Life and over 80 million user created scripts are now running on Mono in Second Life. This talk will discuss our experiences using Mono in Second Life and our plans for the future.
4. Second Life Today
87K
600 2
miles of land
25K
peak concurrency
cores
80M
running scripts
150 +
US$47M
user-to-user
countries 800GB
new content/day
transactions/mo
40M 390TB
US$10M user hours/mo content
exchanged/mo
769K 12Gb
data/s
repeat logins/mo
5. Pixie Dust
• Animations
• Dancing
• Vehicles
• Seats
• Games, guns
• Doors, elevators, teleporters
• Big, tiny, non-human avatars
• Chickens, dogs, bunnies, wildlife
• Customizable hair, shoes, furniture
• In world vendors and web sales
Image Moon over Belgium
6. Scripting Second Life
• Scripts in prims Image Suzanne Graves
• Prims linked to make objects
• Sensors and effectors via library calls
• Communication via IM, email, XMLRPC, HTTP
• Untrusted code
• 2000 scripts per process
• Migration between processes
8. LSL On Mono
Image Ganymedes Costagravas
• Rewrite assemblies for concurrency and mobilty
• Induce stack state (Verification)
• Rewrite bytecode (Reflection.Emit, RAIL, cecil)
• Inject microthreading (JavaGoX, Brakes)
• Serialize stack and heap, transfer assemblies
• Migrate assemblies between app domains to unload
• Subvert profiler for resource limitation
9. Migrating Managed Pointers
• LSL value semantics
• CIL pushes MP
• Can’t copy to heap
• Step back through CIL
• Copy operands to heap Image Bettina Tizzy
• Run CIL on restore
• Resythesise MP
• Microthread all CIL
10. Memory Allocation Monitoring
Image Ka Rasmuson
• Walk object tree between time slices
• Concatenation allows rapid memory consumption
• Limit length of lists and strings
• Hard limit on allocation size
• Exceptions would have been better
• Lucky scheduling gives temporary memory boost
• Yield whenever memory limit might be reached
11. Scheduling
• Check time at yield points
• System call gates execution
• Execution time very variable
• Adaptive timer skipping
• Flywheel exploits Image juria yoshikawa
• Marshalling new bottle neck
12. Managed Execution After A SEGV
• Emergency state save
• Mono replaces handlers
• Disable garbage collection Image The New Media Consortium
• Chain signal handlers
• Definitely void warranty
• Contributed signal chaining
13. Memory Model
• Script Limits
• Resource Pools
• Big Scripts
• Efficient Scripts
• Bytecode Sharing
14. C#
• Arrays
• Primitive Types
• Enumerations
• User Defined Types
• Exceptions
• Ecosystem Image Betina Tizzy
18. C# Types
list l = [“foo”,42]
ArrayList l = new ArrayList(new object[]{“foo”,42})
List l = new List().Add(“foo”).Add(“42”);
llHTTPRequest(url, [HTTP_METHOD, “POST”]);
Library.llHTTPRequest(url, new ArrayList(new object[]{HTTP_METHOD, "POST"});
new HttpRequest().Url(url).Method(“POST”).Request();
• Vector
• Quaternion
• Parsing and Formatting
• ArrayList or object[]
• FooBuilders?
• Versioning?