Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-07

Methods and stacks

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Can somebody please confirm that there's no mechanism by which a method can switch to a private stack.

I've hacked together a very simple round-robin scheduler that I'm using to service serial lines- nothing critical, just simulating LEDs on traffic and summarising packet types. If a method could have a private stack, or there was some variant of QueueAsyncCall() which switched to a private stack, it would be possible to have a Yield procedure or to implement coroutine-type transfers.

Frankly I think I'm at the limit of what can be done without threads, which I've used plenty of times before but I thought I'd explore alternatives.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd: Can somebody please confirm that there's no mechanism by which a method can switch to a…
Show quoted text 9 lines
Can somebody please confirm that there's no mechanism by which a method can switch to a private stack. I've hacked together a very simple round-robin scheduler that I'm using to service serial lines- nothing critical, just simulating LEDs on traffic and summarising packet types. If a method could have a private stack, or there was some variant of QueueAsyncCall() which switched to a private stack, it would be possible to have a Yield procedure or to implement coroutine-type transfers.

AFAIK there is nothing provided by FPC.

Frankly I think I'm at the limit of what can be done without threads, which I've used plenty of times before but I thought I'd explore alternatives.

There are several units helping with thread pools.

http://wiki.lazarus.freepascal.org/Manager_Worker_Threads_System http://wiki.lazarus.freepascal.org/Parallel_procedures

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
> Frankly I think I'm at the limit of what can be done without threads, > which I've used plenty of times before but I thought I'd explore > alternatives. There are several units helping with thread pools. http://wiki.lazarus.freepascal.org/Manager_Worker_Threads_System http://wiki.lazarus.freepascal.org/Parallel_procedures

Thanks both, just checking I've not missed anything obvious.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email