Project

General

Profile

Feature #6695

Configuration for Thread/Fiber creation

Added by ko1 (Koichi Sasada) over 8 years ago. Updated about 3 years ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:46163]

Description

=begin
= Abstract

With Feature #6694, the following configuration parameters should be allowed for Thread/Fiber creation.

Group1 (new parameters):

  • name: Thread/Fiber name
  • vm_stack_size: VM's stack size
  • machine_stack_size: Machine stack size

Group2 (existing parameters):

  • local_storage: Initial Thread/Fiber local parameters
  • thread_group: Thread group (Thread only)
  • priority: Initial priority Thread#priority= (Thread only)
  • abort_on_exception: abort on exception (Thread only)

= Background

With Feature #6694, we have a way to specify configurations for Thread creation. Fiber.new() don't receive any parameters now.

= Proposal

This is a initial proposal of configuration for Thread/Fiber creation.

Group1 (new parameters):

  • name: Thread/Fiber name
  • vm_stack_size: VM's stack size
  • machine_stack_size: Machine stack size

vm_stack_size and machine_stack_size are OS dependent (This means that it will be hint parameter).

Thread#inspect should use `name' parameter.

I also propose a new method Thread#name to get the thread name specified by this parameter.

Group2 (existing parameters):

  • local_storage: Initial Thread/Fiber local parameters
  • thread_group: Thread group (Thread only)
  • priority: Initial priority Thread#priority= (Thread only)
  • abort_on_exception: abort on exception (Thread only)

Now, we can specify Group2 parameters only after thread creation. With this parameter, we can specify parameters before thread creation.

=end


Related issues

Related to Ruby master - Feature #11251: Thread#name and Thread#name=ClosedActions

Also available in: Atom PDF