sorry I missed the opening parentheses for @Arguments first I declared a hash where functions are stored which I call them in thread, like: %FunctionsToLaunchThread = ( "run_script" => \&run_script ); and then I created a thread: $Thread = threads->create( \&WorkThread ); Now I created a subroutine sub runtk where i assigned
$FunctionName = "run_script"; @ArgumentsThread = ($new);
so now the following $FunctionsToLaunchThread{$FunctionName}->(@ArgumentsThread); becomes $FunctionsToLaunchThread{run_script}->($new) which is \&run_script->($new); The above function is expected to call the function in the thread. The run_script subroutine I already shared in previous post. As you said its true I am facing a blocking problem on the device I/O. The thread is created and is loading the do "add.pl" but now in the add.pl I am using network modules, this modules are blocked for the thread to work completely. I am getting following errors: 1. "unable call method purge_all() in the Modem.pm on undentified variable" 2. "undefined value for a shared variable at line.... in Modem.pm" So is there any way to work around this. I wanted to share the working code but it is too big.

In reply to Re^2: Perl/Tk Multithreading by mahis_431
in thread Perl/Tk Multithreading by mahis_431

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.