Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "use threads;" with something else as it is "discouraged" #4

Open
Happy86 opened this issue Oct 18, 2023 · 0 comments
Open

Comments

@Happy86
Copy link
Contributor

Happy86 commented Oct 18, 2023

Hi,

https://perldoc.perl.org/threads#WARNING says:

The "interpreter-based threads" provided by Perl are not the fast,
lightweight system for multitasking that one might expect or hope for.
Threads are implemented in a way that makes them easy to misuse.
Few people know how to use them correctly or will be able to provide help.

The use of interpreter-based threads in perl is officially discouraged.

And https://perldoc.perl.org/perlpolicy#discouraged says:

From time to time, we may mark language constructs and features which
we consider to have been mistakes as discouraged.
Discouraged features aren't currently candidates for removal, but we may
later deprecate them if they're found to stand in the way of a significant
improvement to the Perl core.

Therefore use threads will probably be deprecated and removed in the future.

Though I have not yet looked into it in which "future-proof" way this can be remedied.

Personally I had good experiences with Parallel::Loops.

The usual search on Stackoverflow/... yields:

Of course it could be that interpreter-based threads will never be deprecated (or just before the heat death of the universe in which case this issue is probably mute and can be closed) but I just cannot imagine the Perl core developers just write such a warning for fun...

Best regards,
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant