(2012/10/02 9:42), Aaron Patterson wrote:
> On Tue, Oct 02, 2012 at 08:32:51AM +0900, SASADA Koichi wrote:
>> (2012/10/02 8:22), SASADA Koichi wrote:
>>>
>>> One idea is:
>>>
>>>   - Define: Thread#[] -> Thred#current_fiber#[]
>>>   - Add: Thread#truly_thread_local_get(key)
>>>     and  Thread#truly_thread_local_set(key, val)
>>>
>>> (of course, truly_... is temporal name)
> 
> I prefer this solution.  I want a way to set true thread locals.
> 
>> Another idea:
>>
>> Add an option to derive Fiber local storage at a Fiber creation.
>>
>>   For example:
>>
>>     Thread[:foo] = :bar
>>     Fiber.new(derive_fiber_local_storage: true) do
>>       Thread[:foo] #=> :bar
>>     end
>>
>> And use Fiber in enumerator with this option true.
> 
> I think the "true thread local" solution is better than this because I
> can use it with existing fiber based code.  If a third party library
> uses Fibers, and I want thread locals, it would not be possible with
> this solution.

I'm afraid that people overuse it rather than Fiber local storage.  The
reason why Thread local is Fiber local is that most of thread locals
should be fiber local.

I think we need to discuss carefully.

Akira-san:
  Could you give us your comments?

-- 
// SASADA Koichi at atdot dot net