The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-27-2008
Registered User
 

Join Date: Oct 2007
Posts: 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
Reply With Quote
Forum Sponsor
  #2  
Old 03-27-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,650
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.
Reply With Quote
  #3  
Old 03-27-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 250
^^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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0