Bartosz asks What’s Wrong with the Th

Steven Schveighoffer schveiguy at yahoo.com
Wed Jul 8 19:28:29 PDT 2009


On Wed, 08 Jul 2009 19:34:51 -0400, Bartosz Milewski  
<bartosz-nospam at relisoft.com> wrote:

> Walter Bright Wrote:
>
>> http://www.reddit.com/r/programming/comments/8z3wm/whats_wrong_with_the_thread_object/
>
> The bottom line of this post is that the current Thread object in D  
> should be abandoned and replaced by a more primitive "spawn" function.  
> If there are no serious objections, we are going to proceed with the  
> rewrite.

I'd be interested to know if Sean has seen this.

What you lose in not having a primitive thread be a class is that it's  
more difficult to hook thread runtime events.  However, looking at the  
thread class, nothing is hookable through overriding except for run, which  
means you have a very valid point.

In fact, you could probably implement the current Thread on top of your  
spawn function.  I think it would be a good boilerplate thing, since a  
thread's functionality is often well encapsulated as an object.  Not to  
mention existing code (and lots of it!).

-Steve



More information about the Digitalmars-d mailing list