[#45910] [ruby-trunk - Bug #6694][Open] Thread.new without block. — "ko1 (Koichi Sasada)" <redmine@...>

24 messages 2012/07/04

[#45913] [ruby-trunk - Bug #6698][Open] MacOSXではDir.globが返すファイル名の内容はUTF8-MACですがencodingがUTF-8になっている — "imkira (Mario Freitas)" <imkira@...>

10 messages 2012/07/04

[#45933] [ruby-trunk - Bug #6716][Open] FileUtils.mv でリンク先がないシンボリックリンクファイルを指定すると ENOENT エラーになる — "tommy (Masahiro Tomita)" <tommy@...>

8 messages 2012/07/10

[#45976] [ruby-trunk - Bug #6756][Open] FileUtils.rm_rf がアクセス権のない空ディレクトリを削除しない — "fumiyas (Fumiyasu SATOH)" <fumiyas@...>

9 messages 2012/07/20

[#46012] [ruby-trunk - Feature #6812][Open] Refactor gc.c — "authorNari (Narihiro Nakamura)" <authorNari@...>

13 messages 2012/07/30

[ruby-dev:45982] Re: [ruby-trunk - Feature #6694] Thread.new without block.

From: SASADA Koichi <ko1@...>
Date: 2012-07-20 07:05:51 UTC
List: ruby-dev #45982
(2012/07/20 15:46), shyouhei (Shyouhei Urabe) wrote:
> Forgot to mention to @_ko1 that both POSIX and Windows API starts threads immediately when they are created.
> 
> It is not that obvious what should happen when a thread that was created is not running.

On POSIX and Windows threads, the creation API has configuration
parameter.  Thread.new doesn't have.

> For instance, to join that thread should do what?

Two possible solutions.

1. raise ThreadError
2. wait for thread run and exit.

On second solution, it is easy to understand that the thread created by
Thread.new without procedure (block or parameter) start and stop
(Thread#wait) immediately.

But I prefer 1.

-- 
// SASADA Koichi at atdot dot net

In This Thread