<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote
 cite="mid:38D36C77-DD2A-4862-B075-E8C2B7A6F905@invisibleduck.org"
 type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">I'm hoping this library-level trick will be enough to allow most of the classic synchronization mechanisms to be used in D 2.0.
      </pre>
      <blockquote type="cite">
        <pre wrap="">Re synchronized containers - I don't like the idea at all. That is going down the path of having many shared objects, which is notoriously difficult to get right, especially for non-experts. IMO, shared objects should be small in number, and serve as boundaries between threads, which otherwise play in their own separate sand-pits.
        </pre>
      </blockquote>
      <pre wrap="">A good pathological but functionally correct example is the Thread class in core.thread.  Thread instances should really be labeled as shared, but I know that when this happens the compiler will throw a fit.  The thing is, while some of the methods are already synchronized, there are quite a few which are not and don't need to be and neither do they need the variables they access to be made lock-free.  Even weirder is:
      </pre>
    </blockquote>
    <pre wrap="">Well I think Thread is a threading primitive so we shouldn't expect to be implementable without some oddities.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Sounds good.  Hopefully, it will be uniquely horrifying.
_______________________________________________
  </pre>
</blockquote>
One aspect of the Thread class that I find really annoying is that its
name is of type char[] instead of string. Can we change this please?
Also, it would be nice to have additional constructors that take a name.<br>
<br>
I include thread names in my logs, so all my threads have names. This
means I have code like this:<br>
&nbsp;&nbsp;&nbsp; thread.name = "name".dup;<br>
in the constructors of all my active classes, which is nasty.<br>
</body>
</html>