Koichi Sasada <ko1 / atdot.net> wrote:
> On 2018/02/20 18:06, Eric Wong wrote:
> >Also, what do you think about having a way to pass options to
> >thread creation like pthread_attr_t?
> 
> I like this idea because we don't need to invent new abstraction name.

Me too.

> Or `Thread.create(keyword_args...)` ? (`.create` is an example name).

One problem with a singleton method in "Thread" is separating args
intended for Thread creation vs args for block.  We have the
same problem for Thread.new, too.

Maybe Thread::Attr can be used like Struct:

```
  Thread::Attr.new(type: :coop, ...).new(_a) do |a|
    ...
  end


  class MyActor < Thread::Attr.new(type: :coop)
    ...
  end
  MyActor.new(_a) { |a| ... }
```

> Maybe Eric will be afraid keyword args cost :)

Yes, garbage from kwargs still annoys me; but that's a separate
problem which I hope can be fixed sooner.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>