Nobu,

There are some questions from your patch that I haven't get yet.

(Caleb shared this idea with me) Wouldn't it be good to wake up all
threads from @waiting before freeing the Queue, so that they can raise
the proper exceptions? This way, the kill could be treated more
properly.

The next two question are doubts on how ruby internals work.

I don't get how memsize works. I mean, condvar_memsize, queue_memsize
and szqueue_memsize have a lot in common. If they are correct (and I
assume they are), then I assume that thread_memsize and
thgroup_memsize might not be, as the respective structs have fields of
common types, and the _memsize's are not coherent with the structs
definition.

And I didn't get why the RBASIC from queue_initialize is there. Why
should it be treated as a generic object, rather than its original
class? It may have a purpose, I just was wondering what it was. I
couldn't manage to understand that by myself =/

And, my last question, should I implement other sync primitives with
or without the Thread namespace? I see that you've put C
implementations for Queue, SizedQueue and ConditionVariable in there,
but will the ruby implementations be kept? Will they be outside any
namespace? Should I implement new sync primitives directly in C only,
or it's good to implement them in both ruby and C? Should I keep C
implementations inside Thread and ruby implementations without a
namespace?

Sorry for being so much pedantic. I just want to be sure that I can
help more on my next patches, writing better code, that could be
reviewed more easily, and that could improve ruby better =)

Thanks for all the help!

On Sun, Jul 18, 2010 at 22:07, Ricardo Panaggio
<panaggio.ricardo / gmail.com> wrote:
> On Sun, Jul 18, 2010 at 21:08, Nobuyoshi Nakada <nobu / ruby-lang.org> wrote:
>> Hi,
>>
>> At Mon, 19 Jul 2010 06:51:44 +0900,
>> Ricardo Panaggio wrote in [ruby-core:31345]:
>>> Thanks a lot for all your improvements! And now, thanks a lot for
>>> SizedQueue and ConditionVariable. It was very very helpful.
>>>
>>> I was studying your improvements to get SizedQueue and
>>> ConditionVariable better before sending any patch to the list, but I'm
>>> sure that it couldn't be better than what you've showed us now.
>>
>> It needs to restructure rb_data_type_t, as I've thought for a
>> while.
>
> I've studied the code for away and didn't get it. It seems it's ok for me.
>
>>
>> BTW, is the official name of your project which is listed in
>> <http://rubysoc.org/projects>?  ɧ   >
> The title of my project it "Improving Ruby's Synchronization
> Primitives and Core Libraries" [1]. I have sent my abstract to RubySoC
> organization, but it seems that information have lost its way to them.
>
>> change log such as...
>>
>>  ext/thread: merged from RubySOC 2010 #17 "Coming Soon!".
>>
>
> It's not fair that that huge contribution of yours would be credited to me =/
>
>> --
>> Nobu Nakada
>>
>>
>
> [1] http://pastebin.com/viSnfqe6
>