![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UNIX Message Queues vs. Sockets | zen29sky | UNIX for Advanced & Expert Users | 2 | 03-21-2007 10:56 AM |
| add linux to NIS (unix) domain | legato | UNIX for Dummies Questions & Answers | 1 | 04-14-2005 06:00 PM |
| fd passing between Independent processes using unix domain sockets | Debasisb2002 | HP-UX | 2 | 03-13-2005 10:59 PM |
| UNIX in MS Win2003 Domain | Teamplay | UNIX for Dummies Questions & Answers | 4 | 07-09-2004 02:41 PM |
| Unix Domain | vibhory2j | IP Networking | 1 | 04-20-2004 03:28 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
UNIX domain sockets vs FIFOs
Is there a performance advantage of one of these over the other? Obviously, it makes no sense to use normal TCP sockets or UDP sockets w/ the overhead they carry. But what about UNIX domain sockets vs FIFOs? I'd think they'd be very similar, in terms of performance and in terms of how they're manipulated.
I plan on doing non-blocking I/O on these and using select to decide when to read an interface. Thanks, Matt Gessner |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
They are not interchangable the way pipe() and socketpair() are. Compared to FIFO's, Unix domain sockets are a minor nightmare to use. Two programs can just open a FIFO and then they are talking. With Unix domain sockets, a server has to set up one unix domain socket and go through all the networking business. A client creates a temporary unix domain socket of its own and connects to the servers socket. The server then forks() and starts a conversation with the client. There is a lot of overhead including a fork() just to get the ball rolling. Ignoring the startup overhead, I'm not sure which can send data the fastest. I would go with the FIFO anyway.
But it's good to use Unix domain sockets at least once, so maybe you should do that. That will cure you forever from considering them again. |
|
#3
|
|||
|
|||
|
^^Heh^^ There's a sad story there.
I don't find unix domain sockets that terrible to use and they are still the best local way of bidirectional communication and concurrent data access between many processes. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|