Boost logo

Boost :

Subject: Re: [boost] [thread] patch to allow custom stack size.
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-12-02 03:18:38

Geoff Shapiro wrote
> Vicente J. Botet Escriba <vicente.botet <at>> writes:
>> I don't know. I have submitted a more generic patch *3 years* ago and
>> there is no response yet.
>> :proposal to manage
>> portable and non portable thread attributes
>> Btw, could you take a look at the ticket and tell me what do you think
>> of my proposal?
> Vicente, I have looked at your proposal and I like the direction you
> headed with
> that set of patches. There was a recent request for changes to
> boost::thread to
> allow priority inheritance on thread creation (pthread environments) and
> your
> proposal would cover that with no problem.
> I'd like to see in your example how you see a user incorporating thread
> attribute settings for non-portable attributes.

Here it is what I wrote: "
The portable application needing some specific configuration can construct
portable threads using the following schema

        thread::thread_attributes attr;
        // set portable attributes
        // ...
    #if defined(BOOST_THREAD_PLATFORM_WIN32)
        // ... window version
        // ... pthread version
        pthread_attr_setschedpolicy(attr.get_native_handle(), SCHED_RR);
    #error "Boost threads unavailable on this platform"
        thread th(attr, f,ctx);

Isn't this enough clear?

> Other thoughts that could be considered:
> 1. Would thread priority setting be considered a portable or non-portable
> attribute? There does seem to be quite a bit of variation in this amongst
> different environments. It would be nice if it could be generalized and
> reconciled amongst the different environments.

I don't think so.

> 2. It might be a good thing to be able to specify a default attribute set
> to be
> used in a constructor version not taking an attribute object reference
> (this is
> the current constructor).

The current constructor uses the default native attributes. Is this what you


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at