From: Eric Wong Date: 2018-02-20T09:06:54+00:00 Subject: [ruby-core:85686] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid matz@ruby-lang.org wrote: > May I add two new candidates (IoThread and Thread::Coop)? Thanks for the ideas. I like Thread::Coop; maybe "Thread::Coro" is good, too... I don't think IoThread is good if we support Queue/Mutex/... Also, what do you think about having a way to pass options to thread creation like pthread_attr_t? ``` attr = Thread::Attr.new # similar to pthread_attr_setscope. I'm used to NPTL and # LinuxThreads only having PTHREAD_SCOPE_SYSTEM and ignored # of pthread_attr_setscope until I saw it again with mjit code: attr.type = :coop # (default is :native) # for advanced users only :) attr.vm_stack_size = ... attr.machine_stack_size = ... # This API gives room for future expansion Thread::Attr#create becomes a substitute for Thread.new attr.create(*args) # => Thread or Thread::Coop ``` And maybe we unify Thread::Coop and existing "Thread" as single public "Thread" class to Ruby API; similar to what we do with "Integer" (vs Bignum/Fixnum) Unsubscribe: