Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Alexander Burger
Hi Rand, > > the user stack, there should be sufficient space. As I said, we have 1 > > MB per stack frame, and this can be easily extended with the 'stack' > > function. > > The hardware (CPU) will write at least two words (instruction pointer > and CPU status register, and maybe more) onto the

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread rand
Hi Alex, On May 21, 2013, at 7:02 AM, Alexander Burger wrote: > On Tue, May 21, 2013 at 05:56:52AM +0200, Rand Dow wrote: >> Each co-routine should have it's own separate stack. Best practices with >> stack management today have a sufficiently large stack that grows and then >> terminates in unm

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Alexander Burger
Hi Rand, On Tue, May 21, 2013 at 05:56:52AM +0200, Rand Dow wrote: > Each co-routine should have it's own separate stack. Best practices with > stack management today have a sufficiently large stack that grows and then > terminates in unmapped memory. If it is attempted to grow the stack too OK.

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Alexander Burger
Hi Jorge, > I can only say that under AmigaOS it would certainly be a no-no: > > http://wiki.amigaos.net/index.php/Exec_Tasks#Task_Exceptions > ... > http://wiki.amigaos.net/index.php/Exec_Tasks#Task_Stack No. From what I read there, I believe that they do it the same way I do. They talk about

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Rand Dow
I won't try to "point" to documentation Each co-routine should have it's own separate stack. Best practices with stack management today have a sufficiently large stack that grows and then terminates in unmapped memory. If it is attempted to grow the stack too much, then the program gets a memor

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Jakob Eriksson
Wow, I just have to comment this. Amiga + picolisp in the same post = awesome. /me crawls back under rock On May 20, 2013 at 11:13 PM "Jorge Acereda MaciĆ”" wrote: > Hi, > > I can only say that under AmigaOS it would certainly be a no-no: > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject

Re: Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Jorge Acereda MaciĆ”
Hi, I can only say that under AmigaOS it would certainly be a no-no: http://wiki.amigaos.net/index.php/Exec_Tasks#Task_Exceptions "When an exception occurs, Exec stops executing the tasks normal code and jumps immediately into the exception routine, no matter what the task was doing. The excep

Are PicoLisp's coroutine stacks legal?

2013-05-20 Thread Alexander Burger
Hi all, since nearly three years PicoLisp supports coroutines (64-bit version). Now suddenly it occurred to me that the way I implemented them might be illegal. The problem is how individual stacks for the coroutines are allocated. I do this by reserving space on the stack (by decrementing the st