Welcome to Web-News
A Web-based News Reader
Subject std.thread
From Mike Parker <aldacron71@yahoo.com>
Date Sun, 13 Feb 2005 02:12:50 +0900
Newsgroups digitalmars.D

Two points about std.thread:

1) Considering that the thread class has a public static yield() method,
it would be nice to see a similar sleep method that accepts a
milliscecond argument. There's no way that I can see to sleep in the
current thread without bringing in OS-specific functions.

2) The 2 wait methods are misnamed, IMO. The first reaction I had to
seeing them was that they are sleep methods, but of course they are not.
I think a more appropriate name would be 'join'.

#2 is a matter of taste, but I think #1 is a must have. It's rather
silly that Thread.yield calls Sleep(0) on Windows, but to sleep for a
fixed amount of time one must import std.c.windows.windows and call
Sleep(X) onself.

Recent messages in this thread
 
.# std.thread (Current message) Mike Parker 12-Feb-2005 12:12 pm