digitalmars.D - Call stack mechanism
- Joshua Moore-Oliva (2/2) Aug 14 2009 I am doing research on multi-threaded call stack mechanisms, and in addi...
- Walter Bright (2/8) Aug 14 2009 That's right. It's a layer over the C thread creation mechanism.
- Jarrett Billingsley (13/14) Aug 14 2009 ion to academic papers, I am surveying what mechanisms existing language...
- Brad Roberts (9/17) Aug 14 2009 Answering carefully, neither C, C++ nor D define how threads behave.
I am doing research on multi-threaded call stack mechanisms, and in addition to academic papers, I am surveying what mechanisms existing languages use. Does D use a mechanism other than the standard C-pthread style "one stack is allocated on thread creation for each thread, and if that space is exhausted it is considered an error without recovery"? If so, could you detail your call stack mechanism? Thanks, Joshua Moore-Oliva
Aug 14 2009
Joshua Moore-Oliva wrote:I am doing research on multi-threaded call stack mechanisms, and in addition to academic papers, I am surveying what mechanisms existing languages use. Does D use a mechanism other than the standard C-pthread style "one stack is allocated on thread creation for each thread, and if that space is exhausted it is considered an error without recovery"? If so, could you detail your call stack mechanism?That's right. It's a layer over the C thread creation mechanism.
Aug 14 2009
On Fri, Aug 14, 2009 at 3:44 PM, Joshua Moore-Oliva<josh chatgris.com> wrot= e:I am doing research on multi-threaded call stack mechanisms, and in addit=ion to academic papers, I am surveying what mechanisms existing languages u= se. Does D use a mechanism other than the standard C-pthread style "one sta= ck is allocated on thread creation for each thread, and if that space is ex= hausted it is considered an error without recovery"? If so, could you detai= l your call stack mechanism? That's pretty much it. That being said, druntime and Tango's runtime (basically the same thing..) also allow for the creation of Fibers, which are cooperatively-scheduled threads of execution, as opposed to preemptively-scheduled ones. But they still work pretty much the same way, by allocating a new stack.
Aug 14 2009
On Fri, 14 Aug 2009, Joshua Moore-Oliva wrote:I am doing research on multi-threaded call stack mechanisms, and in addition to academic papers, I am surveying what mechanisms existing languages use. Does D use a mechanism other than the standard C-pthread style "one stack is allocated on thread creation for each thread, and if that space is exhausted it is considered an error without recovery"? If so, could you detail your call stack mechanism? Thanks, Joshua Moore-OlivaAnswering carefully, neither C, C++ nor D define how threads behave. Both C++ and D intend to but even there I don't think they define the specifics of stack usage but rather leave that to the ABI to define. However, practically speaking.. yes, D follows in the footsteps of C and defers that to the pthread libraries for the most part. See the other responses on the thread. Later, Brad
Aug 14 2009