[openamq-dev] Multi-threaded connection requests fail?
Jonathan Schultz
jonathan at imatix.com
Tue Nov 13 23:16:38 CET 2007
Hi Martin,
After a bit of code inspection I would have to say that no I don't think
the code is OK. Have you tried sending SIGINT when multiple connections
are open? I suspect it wouldn't be handled cleanly.
The only clean solution that I can see is to go the whole hog and allow
multiple threads to register the same signal. This is no minor task in
fact, which is probably why we didn't go down this path earlier. Also
note the comment on line 677 of asl_client_agent.gsl
Some reasons why this task is non-trivial include:
1. It will require a hash table whose elements are lists of another
object. Not a huge deal but ASAIK we haven't done it before so may find
that some tweaking of iCL is required.
2. Possible race conditions and such-like, given that different systems
treat signals on multi-thread processes differently in terms of which
thread(s) receive the interrupt. Refer to a discussion on imatix-tech
with subject header 'Signal handlers - howto?' from September 2005.
The alternative would be to deal with it all in application space by
having another control threadlet to deal with signals, since in practice
we don't tend to do much with them besides close connections and
terminate. But I think this is a 2nd best solution.
Jonathan
Martin Sustrik wrote:
> Hi Jonathan,
>
> This warning seems to appear when you create 2 connections, each from a
> different thread, however, it doesn't seem to have any harmful effect.
> Can you confirm it is OK? If so, we can kill the warning.
>
> Martin
>
> Jonathan Schultz wrote:
>>> 14:51:16: Only a single thread may register signals.
>> I don't know if this is connected with the failure to connect, but it
>> does indicate a problem somewhere. A long time ago in a galaxy far away
>> a decision was made in the design of the SMT signal handling code that
>> only a single thread may handle signals. This output indicates that
>> either 1. there is a bug in the signal handling code or 2. Multiple
>> threads are attempting to register signals.
>>
>> Jonathan
>> _______________________________________________
>> openamq-dev mailing list
>> openamq-dev at lists.openamq.org
>> http://lists.openamq.org/mailman/listinfo/openamq-dev
>
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>
>
More information about the openamq-dev
mailing list