Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2005-09-13 03:45:37


In message <uwtm242yy.fsf_at_[hidden]>, David Abrahams
<dave_at_[hidden]> writes
>"John Maddock" <john_at_[hidden]> writes:
>
>> The reason I threw this one in, is that there was a suggestion (from Kevlin
>> Henney's thread proposal if I remember correctly) to decouple thread object
>> creation, from the actual execution of the thread, so that then we can tweak
>> the threads properties with getters/setters before we execute the thread
>> (think thread priority, scheduling policy etc).
>>
>> Does this make sense or am I barking up the wrong tree?
>
>Usually when I hear "let's make an instance in a special
>not-fully-functional state so we can tweak it with getters and setters
>before we really bring it to life," little alarm bells go off. It
>complicates the object invariant and injects often-unwanted state into
>the program. How about using the parameter library to set these
>things up?

Just to clarify, my proposal was that things like these would get passed
in as parameters of thread creation, so constructor arguments, not
post-construction setters. Once a thread is running there are only a few
properties that would be sensibly amenable to "getters and setters",
such as execution priority.

Kevlin

-- 
____________________________________________________________
   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin_at_[hidden]     mobile: +44 7801 073 508
   http://www.curbralan.com        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review
____________________________________________________________

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk