Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Can I/O operations on the same IO::Socket be executed in different threads?

by sundialsvc4 (Abbot)
on May 12, 2015 at 23:35 UTC ( [id://1126478]=note: print w/replies, xml ) Need Help??


in reply to Re: Can I/O operations on the same IO::Socket be executed in different threads?
in thread Can I/O operations on the same IO::Socket be executed in different threads?

And yet, one thought that keeps banging against my head is this:   “even if we can ‘make it to work,” does it ‘make sense?’”   That, to me, is actually a key question here:   “does it actually ‘make sense’ that one thread should ‘only read,’ and that another thread, ‘only write?’”   I don’t think so.   Why?   Because somebody needs to be aware of:   “the present-state of the remote client.”   And, furthermore, this “present-state” can only be ascertained, subject to an unforeseen (and, unforeseeable ...) lag.

Therefore, I suggest that the only truly-practicable design must be this:   “put your letter in the box, raise the flag, and then wait for the postman.”   “The Postman” has no race-conditions within himself.   Therefore, he is able to efficiently serve the needs of any number of clients without conflict.

To my way of thinking, both of the client-processes in question should be reading/writing from queues that are served by the Postman.   They should not be attempting to read/write from the socket directly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found