Hi,
I agree with this proposal. Also add same parameter setting feature for
Thread.
However, I can't make good API to specify stack (VM and machine) size
(and other parameters if there are).
There are several proposals.
Type 1: Thread creating argument (ex: Thread.new(stack_size: 1024))
Type 2: Thread global parameter (ex: Thread.stack_size = 1024)
I think Type 2 is not good (to set default value is okay. However it
conflicts other usage. Typically thread-unsafe).
I also think Type 1 has also problem. If you want to pass keyword
argument "stack_size" to fiber or thread, it should be conflict.
My idea is creating new Thread (Fiber) class with new parameter:
MyThread = Thread.new_template(stack_size: 1024)
MyThread.new{
...
}
# Of course "new_template" is bad name.
Any ideas?
(2011/10/12 21:42), Robert Pankowecki wrote:
>
> Issue #3187 has been updated by Robert Pankowecki.
>
>
> I would also welcome such improvement.
> ----------------------------------------
> Feature #3187: Allow dynamic Fiber stack size
> http://redmine.ruby-lang.org/issues/3187
>
> Author: Mike Perham
> Status: Open
> Priority: Normal
> Assignee:
> Category:
> Target version: 1.9.x
>
>
> =begin
> I'd like a way to increase the size of the Fiber stack dynamically so when my program starts, I can set it to whatever value I need for the code I'm running. 4KB is too easy to run into problems when running recursive code but settling on any arbitrary static value seems pointless to me.
> =end
>
>
>
--
// SASADA Koichi at atdot dot net