1

I want to know how to execute two subroutines in parallel.

In Perl Tk, I am using one buttons widget and text widget.

Button : is to execute the parser function Text : is to display the print statement of the parser

Thing is that after executing the parser function only the text widget is getting executed [because Perl support sequential execution]

But I want both of them to be executed in parallel.

1 Answer 1

1

Implement a fork and have the child process launch the second subroutine and communicate the results to the parent process via interprocess communication (IPC).

You can also try to use threads, though it would not be my recommended solution

P.S. The discussion on this SO question should also prove informative, though is not 100% the duplicate of your need:

How can I signal a forked child to terminate in Perl?

Sign up to request clarification or add additional context in comments.

2 Comments

What’s your experience with IPC::Shareable?
@tchrist - Aware it exists, never used. I like the POD warning: "Certainly; this is beta software..."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.