When I run my perl script that uses threads I get the following error, a google search shows only 2 results, 1 is russian and I can't read it, the other is a blog that no longer seems to have the issue listed.

Can't locate auto/threads/is_joinable.al in @INC (@INC contains: /etc/ +perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /us +r/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl /usr/lib +64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/s +ite_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_ +64-linux-thread-multi /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl + .) at ./OEFS.pl line 32

Currently I am trying to make sockets and threads work as I intend before writing the rest of the code, so it is a pretty simple script so far.
here is OEFS.pl:
#!/usr/bin/perl use strict; use IO::Socket::UNIX; use threads; use threads::shared; my $LSocket; my @Links; my $NumConnections = 32; #allow for 32 connections my @Connections = (1 .. $NumConnections); my @StructDs : shared; my @StoreDs : shared; sub ConThread($); MAIN: { die("The first and only requirement should be the name for this OE +FS instance, and is required!\n") if (!($ARGV[0])); #Start the listener mkdir("/tmp/OEFS/") if (!(-e "/tmp/OEFS")); unlink('/tmp/OEFS/' . $ARGV[0]); $LSocket = new IO::Socket::UNIX('Listen' => 1, 'Local' => '/tmp/OE +FS/' . $ARGV[0]); die("$!\nUnable to create listen socket!\n") if (!($LSocket)); my $Link; my $IDX; print("Listening...\n"); while ($Link = $LSocket->accept()) { #Clean out old threads foreach my $I (1 .. $NumConnections) { if (($Links[$I]) && ($Links[$I]->is_joinable())) { $Links[$I]->join(); unshift(@Connections, $I); print("Connection #$I now free\n"); } } print("Incomming Connection\n"); $IDX = pop(@Connections); if ($IDX) { print("Using connection #$IDX\n"); print("Spawning Thread\n"); #New thread. $Links[$IDX] = threads->create(\&ConThread, $Link); } else { print("Too many connections\n"); print $Link "Maximum number of connections has been reache +d.\n"; $Link->close(); } } } sub ConThread($) { my ($Socket) = @_; print $Socket "Ready\n"; $Socket->close(); return; }

here is the program I am using to access OEFS.pl through the socket, the error occurs when I run it a second time to make sure the first connection is cleared:
#!/usr/bin/perl use strict; use IO::Socket::UNIX; my $TheSocket; MAIN: { die("The first and only requirement should be the name of the OEFS + instance, and is required!\n") if (!($ARGV[0])); $TheSocket = new IO::Socket::UNIX('Peer' => '/tmp/OEFS/' . $ARGV[0 +]) || die("$!\nUnable to connect!"); print "Socket says: " . <$TheSocket> . "\n"; $TheSocket->close(); exit(0); }

In reply to threads, is_joinable issue. by exodist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.