I have a perl script that works correctly, but it uses only 1 core of my 2-core processor, how can I get it to use all the kernels.
I know that I can create threads using threads-> new (); but how do I fit this into something like:
my $twig= new XML::Twig::XPath(TwigRoots => {TrdCaptRpt => \&top_level}); $twig->parsefile($file);
where the subroutine is called by something else.
The standard approach with Perl is to not try to use multiple cores with a single script call, but instead run jobs in parallel on separate cores.
, Perl, Perl-Threading () . , , Perl , . , , , .
XML:: Twig. , . script , - script, . , script, 2 script (, xargs?).
Source: https://habr.com/ru/post/1792570/More articles:integrate search into the header / main page of asp.net MVC site - searchStop Gsson from annotating to class introspection - javajQuery change cursor to link by link - javascriptUse Jackson JSON processor without annotations - jsonCross DomainDataSource Combobox SelectedItem Binding - data-bindingDifferent PostgreSQL sequence identifier in database and in JPA - javaIs there an alternative to BinaryFormatter that works in a trust environment - securityWPF Calendar: Configuring a control to display calendar numbers - wpfElementTree XPath weird behavior - pythonreturn the first n letters of a column - sqlAll Articles