Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Looking for alternative for IPC::Shareable (or increase size)

by ikegami (Patriarch)
on Aug 06, 2020 at 04:30 UTC ( [id://11120394]=note: print w/replies, xml ) Need Help??


in reply to Looking for alternative for IPC::Shareable (or increase size)

Threads are not deprecated. Threads are fully supported.

The docs say that threads are discouraged. When pressed for an explanation, the reason given for that message was that ...threads are hard and the people in some IRC channel don't want to answer questions about threads?

Ok, that might not be exactly right, but the answer I got back was clear a mud. Read it for yourself.

What's relevant to me is this:

As one of several people who have maintained the various threads modules over the years, I regret that I missed being part of the original discussion that lead to the inclusion of the 'discouraged' message.

The fact is that threads work, they are maintained, and they currently do not have any bugs preventing their use. I acknowledge that not all Perl modules are thread-safe, but there is sufficient documentation to that affect in the POD.

There's also a performance penalty to adding thread support to a Perl, but that penalty applies to whether you use threads or not, and it's pretty common for the system perl to have thread support, so you're probably already suffering from that penalty.

Replies are listed 'Best First'.
Re^2: Looking for alternative for IPC::Shareable (or increase size)
by DomX (Novice) on Aug 06, 2020 at 07:26 UTC
    Dear ikegami,

    this sounds to me, my first steps with IPC I made with threads, was already good? This is some years ago, and I think this would cause me nearly building the whole program new, to change back to this system... I'll consider it if nothing else is satisfactorily...
Re^2: Looking for alternative for IPC::Shareable (or increase size)
by perlfan (Vicar) on Aug 11, 2020 at 01:49 UTC
    perl ithreads are not actual light weight OS threads that share the same common name (nobody actually says "ithreads" referring to perl "threads" from what I've seen) and many people look at them merely because of this unfortunate naming choice. Maybe OP wants to look at Coro.

    https://metacpan.org/pod/Coro#WINDOWS-PROCESS-EMULATION

      They're a bit expensive to start up, and there's a cost to sharing data between them. Neither of those things are issues most of the time.

      Coro is a co-operative multitasking system. Possibly useful, but not exactly threads.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120394]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-03-29 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found