in reply to 5005threads -> ithreads (porting)

I must say I don't understand the problems you had with segfaults. I can't reproduce them, at least not with the piece of code given here.

I wonder though if this:

BEGIN { if ($Config{use5005threads}) { debug( "5005 Threads\n" ); eval 'use Thread qw(yield); use Thread::Queue'; die $@ if $@; $conn = start_connection( 1 ); $telnetprintqueue = Thread::Queue->new; $screenprintqueue = Thread::Queue->new; $connectqueue = Thread::Queue->new; } elsif ($Config{useithreads}) { debug( "I-Threads\n" ); eval 'use threads; use threads::shared; use Thread::Queue'; die $@ if $@; share( $CONNECT ); share( $PromptType ); $telnetprintqueue = Thread::Queue->new; $screenprintqueue = Thread::Queue->new; $conn = start_connection( 2 ); } else { debug( "No Threads\n" ); $conn = start_connection( 0 ); } }

actually works or breaks for you. I realize that in general you don't want string eval's, but these string eval's are happening once at compile time from a fixed string. And compile time itself is nothing but a string eval anyway. I guess that's the exception to the rule ;-)

Anyway, my approach feels cleaner to me, avoiding the forest of requires and imports.

Hope this helps.

Liz