Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

RE: Just enough to be dangerous (on threads) indeed! :-)

by lhoward (Vicar)
on Aug 25, 2000 at 22:27 UTC ( #29683=note: print w/replies, xml ) Need Help??


in reply to Just enough to be dangerous (on threads) indeed! :-)
in thread When is a while not a while?

> With threads the two can communicate directly 
> through an internal buffer (they share the same memory).
You can do this with separate processes by using SysV IPC.
> With Unix you don't have to worry about how 
> you use data, but there is more overhead. With
> threads you do have to be careful because 
> the threads can trample over each other, 
> but you can get  better performance.
And you gain (just about) all the benefits (and problems; plus a few new ones) of threads when you use SysV IPC.

Not coming down on tilly, just bringing up an alternative.

  • Comment on RE: Just enough to be dangerous (on threads) indeed! :-)

Replies are listed 'Best First'.
RE (tilly) 2: Just enough to be dangerous (on threads) indeed! :-)
by tilly (Archbishop) on Aug 25, 2000 at 22:33 UTC
    Ack! I knew that as well. It is just that fork() is so much a Unix idea that I think of it as "the Unix way" even though Unix also has many other ways of working.

    Incidentally on machins that support it, you can use shared memory from Perl with IPC::Shareable.

      I find IPC::Shareable extermely handy. Very frequently I want programs to be able to exchange some pieces amounts of data; and I want them to do it quickly. Files are too slow and "real" TCP/IP networking can be a hastle for just sharing a little data. Also when the processes aren't related (i.e. they wouldn't fork to create each other under the processes model ; they wouldn't be separate threads under the therading model) it is just really handy to use IPC::Shareable.

      Its just that so many people think its either "pipes or TCP/IP" when their processes need to communicate. SysV IPC is extremely apropriate for some problems.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-08-04 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?