Boost logo

Boost Users :

Subject: Re: [Boost-users] [fiber] pooled_fixedsize_stack
From: DePizzottri (depizzottri_at_[hidden])
Date: 2017-09-14 04:12:32


Boost - Users mailing list wrote
> On 14/09/2017 03:03, DePizzottri via Boost-users wrote:
>> I realized that pooled_fixed_stack is not thread safe. Now the question
>> is
>> how to make pooled_fixed_stack mutithread safe?
>
> Fibers are usually bound to a single thread each; can't you just use a
> separate stack instance for each thread?
>
> _______________________________________________
> Boost-users mailing list

> Boost-users_at_.boost

> https://lists.boost.org/mailman/listinfo.cgi/boost-users

Yes, i tried to instantiate pfs as thread_local inside fiber routine that
spawns other fibers:

thread_local bf::pooled_fixedsize_stack salloc{ 2 *
bf::pooled_fixedsize_stack::traits_type::page_size() };

crashes become rare, but did not completely disappear.

I thought that allocate call to stack allocator appears only at fiber
creation time inside parent's body, but it seems to be there is exists some
other conditions that cause race.

--
Sent from: http://boost.2283326.n4.nabble.com/Boost-Users-f2553780.html

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net