User:Which Linden/Office Hours/2009 Mar 12

From Second Life Wiki
< User:Which Linden/Office Hours
Revision as of 12:04, 12 March 2009 by Which Linden (talk | contribs) (New page: * [11:05] Morgaine Dinova: Ah cool * [11:05] JayR Cela: did uou notice that the official Linux veiewer and a realease canidate are both for do...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • [11:05] Morgaine Dinova: Ah cool
  • [11:05] JayR Cela: did uou notice that the official Linux veiewer and a realease canidate are both for domnload
  • [11:06] Which Linden: Hey there!
  • [11:06] Morgaine Dinova: Hiya Which!
  • [11:06] Which Linden: Big crowd this morning
  • [11:06] Which Linden: Nice kitty av, Morgaine
  • [11:07] Morgaine Dinova: I like it, it's transformed my outlook on life :-)
  • [11:07] JayR Cela: lol
  • [11:07] Morgaine Dinova: Although it needs scripts to do it justice :-)
  • [11:08] Morgaine Dinova: Especially nice when both Imaze and I come as kitties, and do the double act :-)
  • [11:08] Which Linden: Ha ha ha, all your pictures are now close-ups of knees?
  • [11:08] Which Linden: I say that because at one point as my sister was gowing up we gave her a camera and the result was exactly that. Really gave us insight into what her world was like at age 7
  • [11:09] Morgaine Dinova: Could be worse ... I could be a nice little virus from my microscopic world ... then my visuals and sitting would be even more problematic ;-)
  • [11:09] Morgaine Dinova: LOL Which
  • [11:09] Morgaine Dinova: Gives things perspective, hehe
  • [11:10] Which Linden: In the literal sense!
  • [11:10] Morgaine Dinova:  :-)
  • [11:10] JayR Cela: so whats up with 1.22.11.113976 & 1.22.11.113941 downloads
  • [11:10] Which Linden: I don't know, is anything wrong with them?
  • [11:10] JayR Cela: on linux ?
  • [11:10] Morgaine Dinova: Don't know, I only use Imprudence RC2 now
  • [11:10] JayR Cela: they both work
  • [11:11] Morgaine Dinova: That's shocking
  • [11:11] Which Linden: Yeah....srsly
  • [11:11] JayR Cela: he did some good work with that viewer / i like the invetory improvements
  • [11:11] Saijanai Kuhn: hey again all. Hey which
  • [11:11] Which Linden: wb sai
  • [11:12] JayR Cela: hi there Sai :_)
  • [11:12] Saijanai Kuhn: Hi JayR
  • [11:12] Which Linden: So, um, I don't really have a technical topic here today; I'm working on getting the results of the message queue evaluation more presentable
  • [11:13] Saijanai Kuhn: Which I've been trying to add a GUI to the pyogp project using wxpython, but now that Enus has switched to using eventlet, I'm totally lost... Any suggestions?
  • [11:13] JayR Cela: oh ? hows that comeing along ?
  • [11:13] Morgaine Dinova: Is there a verdict on that, Which? RabbitMQ looking good?
  • [11:13] Which Linden: I saw your email to eventletdev, sai, and I probably should have replied by now
  • [11:13] Which Linden: Morgaine: well....you'll just have to see :-)
  • [11:13] Morgaine Dinova: kk
  • [11:14] Saijanai Kuhn: Enus just released some sample code to handle local and private IM, Jay R and I believe that you can now rez boxes with another bit of sample code
  • [11:14] Morgaine Dinova: Oh, you mean we'll actually get to see the report?
  • [11:14] Which Linden: yeah, the whole thing...basically our testing notes cleaned up
  • [11:14] Morgaine Dinova: Blimey!
  • [11:15] Morgaine Dinova: LL++ :-)
  • [11:15] Morgaine Dinova: And Which++ of course <giggle>
  • [11:15] JayR Cela: lol LL++
  • [11:15] Which Linden: Sai: I'm not really sure how eventlet really changes the flow of things so I don't really know where to start
  • [11:15] Saijanai Kuhn: LOL me neither
  • [11:16] Which Linden: I guess enus really refactored pyogp? I assume that several changes happened at once
  • [11:16] Saijanai Kuhn: what I was doing originally was placing the UDP loop into a wx timer, and starting separate threads for the eventqueueget loops
  • [11:17] Saijanai Kuhn: the logger output was being rerouted to wx text boxes via the event queue, but that all assumes that the timer and so on are in spearate threads from the main wx thread
  • [11:17] JayR Cela: so whats up with the MONO compiler / i have some particle scripts that get really flakey when i recompile from LSL to Mono ?
  • [11:17] Morgaine Dinova: Oh boy. /me gets Sai a BIG box of aspirin
  • [11:17] Saijanai Kuhn: As far as I can tell, that's no longer hte case with evenlets: its all in the main thread, as far as Python is concerned
  • [11:17] Which Linden: yeah, eventlet uses green threads
  • [11:18] JayR Cela: put em back to LSL and they work normaly again
  • [11:18] Morgaine Dinova: greenlets
  • [11:18] Which Linden: JayR: hmm... that's not really my field -- I recommend that you try and describe the bug as clearly as possible in a JIRA
  • [11:18] Saijanai Kuhn: so the question is: how to give time to the wx thread AND the evenlets
  • [11:18] Which Linden: also....check to see if it gets fixed in 1.26
  • [11:18] Which Linden: Sai: well, wx thread is already spun off into its own thread, right?
  • [11:19] JayR Cela: 1.26 ?
  • [11:19] Saijanai Kuhn: I'm pretty sure the eventlets aren't going to step on any of hte wx address space, so its just a matter of time-sharing
  • [11:19] Morgaine Dinova: I fixed up the greenlet dependency on the wiki, nad also noted that SVN 1.5 actually works fine now, unlike claimed.
  • [11:20] Which Linden: Oh, nice!
  • [11:20] Saijanai Kuhn: the way wx works, it takes the main thread for itself. I just don't see how to schedule the eventlet stuff to give time BACK to the main thread
  • [11:20] Which Linden: Oh...uhh, well you can spawn off the eventlet main loop into its own thread
  • [11:20] Saijanai Kuhn: oh......
  • [11:20] Which Linden: Like, thread.run(pyogp.main_loop)
  • [11:20] Saijanai Kuhn: doh
  • [11:21] Saijanai Kuhn: I had hopes it was going to be something stupid like that... and I was right
  • [11:21] Which Linden: (I've never actually looked at that code so the syntax is definitely off)
  • [11:22] JayR Cela: sigh's I want my old Atari back
  • [11:22] Which Linden: Oh, jayr, 1.26 is the upcoming server release
  • [11:22] Morgaine Dinova: Ideally though, the wx mainloop should be just a coroutine. Does wx work with Stackless? If so, there should be a coroutine for it.
  • [11:22] Saijanai Kuhn: sure, but I guess I was confused or not thinking things through. I was stuck on eventlets being all in one thread and therefore you couldn't split the time between the wx thread and the eventlets
  • [11:23] JayR Cela: @Which / thanks :_)
  • [11:23] JayR Cela: i was a lil confused there
  • [11:23] Which Linden:  :-) We have a numbers-based language all of our own here
  • [11:23] JayR Cela: so the servers are all Debian same version now ?
  • [11:25] Saijanai Kuhn: so, just start teh whole evenlet thing in a new thread... So now its just a matter of figuring out how to control the evenlet thread...
  • [11:25] Which Linden: Sai: the conceptual model of green threads is hard to get your head around initially, and it's not well documented anywhere. For me, the best way to think about it is hierarchically: a process is the biggest most expensive flow-of-control unit, and a process can contain many threads, and each thread can contain many green threads
  • [11:25] Saijanai Kuhn: very thread-ignorant
  • [11:25] JayR Cela: eeek :(
  • [11:25] Which Linden: JayR: I'm not sure about the operating system versions -- I think we're mostly on Etch but there are probably stragglers
  • [11:26] Which Linden: Sai: what do you mean "control"?
  • [11:26] Saijanai Kuhn: right, I've got a vague idea of what is going on: the entire python process basically lives in its own native thread and python threads are a fudge to keep the python interpreter from stepping on itself
  • [11:26] JayR Cela: i think i go buy a Mac
  • [11:26] Which Linden: Oh...yeah, python threads are a different beast to normal threads, too
  • [11:26] Saijanai Kuhn: well, I'm probably using the wrong term
  • [11:28] Morgaine Dinova: Well if you use a sequential language to handle a parallel problem, you can be certain of messy hacks and trouble ahead ;-)
  • [11:28] Saijanai Kuhn: what i was doing with the old pyogp code was to control pyogp from a timer event: perform each segment in its own discrete function, do the debug logger I/O and stop. Next timer event, the next step would get called, then stop, etc
  • [11:28] Saijanai Kuhn: that way the logger i/o could get displayed in the wx window.
  • [11:29] Which Linden: How does the logger do it's I/O?
  • [11:29] Saijanai Kuhn: once I got to a certain point, I'd fire up separate threads for the event loop, and just continue to call the UDP code from the timer loop
  • [11:29] Which Linden: Morgaine: true
  • [11:29] Saijanai Kuhn: normally it sends it to stdio. I reroute it to a wx text box (or 50) and defer the "print" until the wx thread gets active again
  • [11:30] JayR Cela: someone got U-Tube on a prim
  • [11:30] JayR Cela: i got free ones I think
  • [11:30] Saijanai Kuhn: the logger class will "print" to any file-like object, so you just add a bit of code to the textbox class and it works transparently
  • [11:31] Saijanai Kuhn: its how wx handles its own separate debugger window
  • [11:31] Which Linden: Oh... how about writing to a shared stream like a StringIO object and periodically dumping its contents into the wx window?
  • [11:31] Saijanai Kuhn: could do that too.
  • [11:31] Morgaine Dinova: Concurrency is bad enough when done right: you still have to fight non-determinacy, deadlock, livelock and other nasties. When you use a hacked solution, all bets are off.
  • [11:31] Saijanai Kuhn: the question is periodicies
  • [11:31] JayR Cela: gave you Rox Tube 0.8.7 - Public Beta - Gui - Small.
  • [11:32] Rox Tube: 0.8.7 - Public Beta - Gui - Small: Welcome to the RoxTube beta test, this product is capable of loading YouTube content into Secondlife
  • [11:32] Rox Tube: 0.8.7 - Public Beta - Gui - Small: Use the Menu to Search all of YouTube, millions and millions of videos or Paste a YouTube URL manually
  • [11:32] roxtube beta: 0.55 - screen - gui: Your RoxTube is obsolete. I am sending the latest version to you now.
  • [11:32] roxtube beta: 0.55 - screen - gui owned by Nitrox Peel gave you 'Rox Tube 0.9.8 - 25thumb - 1Prim - Public Beta - Gui - Resize' ( [1] ).
  • [11:32] Saijanai Kuhn: Morgain, its perfectly threadsafe and all that. It schedules things in the wx event queue and waits until wx has the ative thread again
  • [11:32] Rox Tube: 0.8.7 - Public Beta - Gui - Small: Say the YouTube url in chat within 60 seconds
  • [11:33] Morgaine Dinova: Is something displaying?
  • [11:33] Rox Tube: 0.8.7 - Public Beta - Gui - Small: Loading
  • [11:33] Which Linden: [2]
  • [11:33] Which Linden: I dunno morgaine
  • [11:33] JayR Cela: i not even shure it works
  • [11:33] Rox Tube: 0.8.7 - Public Beta - Gui - Small: Loading
  • [11:33] Which Linden: I agree with both morgaine and sai: it's a lot of work to make things threadsafe but it's possible if you're careful
  • [11:34] Saijanai Kuhn: doesn't it need to use the parcel media url?
  • [11:34] Which Linden: I'd assume it does.... which is currently used by the etherpad display up there
  • [11:34] Which Linden: Oh... it set it to a different url
  • [11:35] Which Linden: Seems to be corrupted though
  • [11:35] Morgaine Dinova: Heh, thread safety is the least of it. Thread safety is ASSUMED, otherwise you have a totally dead system. Those problems I mentioned come *after* you've got total thread safety.
  • [11:36] Which Linden: Right, well, there's a paper out there about how threaded systems inevitably have deadlocks
  • [11:36] Saijanai Kuhn: Well, that's the thing with wx. It all runs in one thread. Eventlets runs in its own native pool of threads. My problem was not realizing that I could spawn the entire evenlet code into its own thread
  • [11:36] Saijanai Kuhn: own *python* thread
  • [11:38] Saijanai Kuhn: so the only refactoring that I need to do is provide a "hook" for wx to setup the initial evenlet thing in its own thread from the idle or timer loop, and then just do the control calls for evenlet as normal
  • [11:38] Which Linden: So it sounds like the primary refactoring you're doing is changing it from a tick-driven network system to a network system in its own main loop
  • [11:38] Saijanai Kuhn: I guess. The python threads for the eventloop would yield time back to wx no problem
  • [11:39] Saijanai Kuhn: it was Enus "while x == true: doeventletstuff
  • [11:40] Saijanai Kuhn: that was giving me problems. If I call a while loop from the timer event, it never returns. If I wanted to call it one iteration at a time, I'd need to go dig all the evenlet code out of pyogp and factor it into something callable from the timer event
  • [11:40] Saijanai Kuhn: never occured to me to think in terms of eventlet living in its own thread in the first place
  • [11:41] Morgaine Dinova: So you have a clear way forward now Sai?
  • [11:41] JayR Cela: i'm lost
  • [11:41] Saijanai Kuhn: I'll need to see how to put all of the evenlet stuff into its own thread and then refactor pyogp to do that on demand, but I think its doable
  • [11:42] JayR Cela: is like a sub routine ?
  • [11:42] Saijanai Kuhn: JayR. Sorta. LIke a sub-process using its own CPU sorta
  • [11:42] JayR Cela: just pack it up and recall when you need it ?
  • [11:43] JayR Cela: that would make sense to me
  • [11:43] Saijanai Kuhn: well that was how I was doing it before: just put everything into a function that I called from the wx timer event
  • [11:43] Which Linden: The funny thing about python threads is that they kinda share the same cpu, they aren't completely free-running
  • [11:43] Saijanai Kuhn: but eventlets don't work like normal functions (or threads) so I was getting cornfused
  • [11:43] Saijanai Kuhn: Which, I know, but if you look at the interpreter as the "CPU" it still makes sense
  • [11:44] JayR Cela: hmmmmmm
  • [11:44] Morgaine Dinova: JayR: think of coroutine like two subroutines that can call each other, but instead of entering from the top, they enter the body of the other at the point they left off last time. And there is no call stack to grow.
  • [11:44] JayR Cela: ahhhhh / OK
  • [11:44] Morgaine Dinova: Not quite like that, but it's a picture
  • [11:45] Saijanai Kuhn: LOL that pretty much lost me, but if JayR gets it, its all good
  • [11:45] Morgaine Dinova: LOL
  • [11:45] JayR Cela: is like progaming in BASIC
  • [11:45] JayR Cela: you just make lil modules and call them
  • [11:45] Morgaine Dinova: OK, I'll join in the general happiness too then: WTF? :-)
  • [11:46] JayR Cela: routine tasks
  • [11:46] Saijanai Kuhn: LOL now we're all happy (confused)
  • [11:46] Which Linden: raw coroutines are really confusing, eventlet packages them up so they act a bit more like threads
  • [11:47] Morgaine Dinova: Does Python 3 handle this natively?
  • [11:47] Saijanai Kuhn: doubtful
  • [11:48] Morgaine Dinova: That's a pity. Now that we're in the Age of Multicore, languages should start adding proper infrastructure for concurrency under the hood.
  • [11:48] Which Linden: I think python 3 has extended generator support which approaches coroutines but is not quite
  • [11:48] Saijanai Kuhn: Well eventlets should use multicores because they're native threads behind the scenes
  • [11:49] Saijanai Kuhn: I think
  • [11:49] Saijanai Kuhn: hence the "greenlet" name
  • [11:49] Morgaine Dinova: I thought it was short for green let tuce
  • [11:50] Which Linden: Sai: they're not
  • [11:51] JayR Cela: i think i go write some 6502 machine code / Lol :_)
  • [11:51] Saijanai Kuhn: ah, so I'm more confused than ever
  • [11:51] JayR Cela: that would be easy
  • [11:51] Saijanai Kuhn: 6502 is the original riSC processor
  • [11:51] Which Linden: The way greenlet works is that when it switches from one coroutine to the next it scoops up the interpreter stack into heap memory and then replaces the top of the stack with the new coroutine's stack
  • [11:52] Which Linden: This is really efficient because it only has to copy on the order of hundreds of bytes, and it doesn't invalidate much cpu cache (unlike thread and process switching whicn involve much more data copied and more invalidation)
  • [11:52] JayR Cela: scoops / ohh my we need a kitty litter box now :_)
  • [11:52] Morgaine Dinova: lol
  • [11:52] Which Linden: You could implemente greenlets with threads, but, it'd be really really slow
  • [11:53] JayR Cela: sorry sis / i just had to say that :_)
  • [11:53] Saijanai Kuhn: OK. I guess I misread something somewhere where it was talking about native threads
  • [11:55] Morgaine Dinova: [3]
  • [11:55] Which Linden: Nice
  • [11:55] Morgaine Dinova: I hope it makes PyOGP sing :-)
  • [11:55] Saijanai Kuhn: I wonder if there's a picture in Oreilly's library that can be used for the book Donovan writes
  • [11:56] Morgaine Dinova: I didn't know Donovan was writing one, that;s cool
  • [11:56] Saijanai Kuhn: I didn't either.
  • [11:56] Which Linden: I don't think he is?
  • [11:56] Which Linden: "Well he should!"
  • [11:56] Morgaine Dinova: Hehe
  • [11:56] Saijanai Kuhn: right
  • [11:56] Saijanai Kuhn: and use a 19th century woodcutting of a greenlet on the cover
  • [11:57] JayR Cela: Oreilly ?
  • [11:57] Saijanai Kuhn: O'Reilly books. They publish hundreds of computer books, like Java in a Nutshell and so on
  • [11:57] Morgaine Dinova: The greenlet should be pecking at a Py!
  • [11:58] Saijanai Kuhn: and they always have a drawing of an animal on the cover
  • [11:58] JayR Cela: the news guy ? / ohh yeah / duhh :_)
  • [11:59] Saijanai Kuhn: [4]
  • [11:59] JayR Cela: well nice seeing yall again
  • [11:59] Which Linden: So.... yeah! Lemme know if there is anything else I can help you with re: eventlet, Sa
  • [11:59] Which Linden: *Sai
  • [11:59] Which Linden: Nice seeing you jayr
  • [12:00] Saijanai Kuhn: great, thanks. It sounds like I have to tdo some reading but at least I have a direction in which to head
  • [12:00] JayR Cela: byee-byee *bigg hugss* to everyone
  • [12:00] Saijanai Kuhn: laters JayR
  • [12:00] Saijanai Kuhn: and thanks muchlee Which
  • [12:00] Morgaine Dinova: Looking along my shelf, I'm actually surprised how few are O'Reilly, about 15. The vast majority are Addison Wesley and Wiley.
  • [12:01] Morgaine Dinova: Uh oh, half the audience disappeared while I was looking at books, hehe
  • [12:02] Which Linden: I should duck out too
  • [12:02] Which Linden: Thanks for being here, enjoyed talking with you!
  • [12:02] Morgaine Dinova: Thanks Which, always fun here.
  • [12:02] Saijanai Kuhn: thanks much WHich I sorta think I can do this sorta now kinda almost
  • [12:02] Morgaine Dinova: That's very cool Sai
  • [12:02] Which Linden:  :-)