On Oct 04, 2006, at 1:09 AM, Guyren Howe wrote:
On Oct 4, 2006, at 1:25 AM, Norman Palardy wrote:
The feature that Stackless Python implements is the coroutine.
Coroutines are quite easy to do in C
setjmp / longjmp are pretty much built for this
Well, theoretically, yes, and practically, meh, it's problematic.
From the Wikipedia article on coroutines:
They work just fine.
Wrote a compiler once upn a time with them (15+ years ago) + a few
CPU simulators.
My point about C was that if I have my history correct, it was the
rapid and thoroughgoing adoption of C as the world's programming
language that saw the world adopt imperative, structured and stack-
calling as the basis of all popular languages.
As Andy mentions I think he's correct that it was not C that
introduced this.
B or BCPL (if we can assume Wikipedia is authoritative)
Sure, you *could* do object-oriented programming in C (Objective C
was first implemented as a set of C macros, I believe), and you can
do coroutines in C. But who does?
And this doesn't detract from: you can't do coroutines in REALbasic
right now, and it would be nice if we could.
THAT would be useful
OTOH, adding features to the threading in REALbasic would only
complicate moving to OS threads, which as everyone is aware, is now
a Really Good Idea(TM).
RB does use OS threads.
They are just scheduled in a way that makes them behave like
cooperative threads and not pre-emptive OS threads.
I quite certain Mars has stated this before (in fact just recently)
In a thread titled "Re: possible feature request?"
On Aug 25, 2006, at 9:35 AM, James Milne wrote:
The REALbasic memory manager and object management system is not
thread-safe from the OS point of view. That's why REALbasic
threads are not real threads, but rather 'light-weight' fake
threads that the REALbasic scheduler jumps between.
Threads created with the REALbasic thread class are real threads,
created with standard system calls, managed by the standard system
thread scheduler. There were a couple of versions where we used a
custom, cross-platform thread library, instead of system services,
and I suppose that system could have been called "fake threads";
but we abandoned that approach quite some time ago.
Mars Saxman
REAL Software
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>