• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Writing on a common socket from multiple threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing on a common socket from multiple threads


  • Subject: Re: Writing on a common socket from multiple threads
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Wed, 1 Jun 2011 17:03:59 -0700

On 1 Jun 2011, at 16:50, Josh Graessley wrote:

> One common problem with writing on a single socket from multiple threads is interleaved data.

Another one relates to closing.  You have to make sure that you carefully coordinate the close of the socket, lest you run into problems like this:

1. thread A is writing to socket X via fd

2. thread B decides its time to close fd

3. thread C opens a file Y and gets back fd as the file descriptor

4. thread A is now writing to file Y rather than socket X

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Writing on a common socket from multiple threads
      • From: Nathan Sims <email@hidden>
References: 
 >Writing on a common socket from multiple threads (From: Nathan Sims <email@hidden>)
 >Re: Writing on a common socket from multiple threads (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: Writing on a common socket from multiple threads (From: Nathan Sims <email@hidden>)
 >Re: Writing on a common socket from multiple threads (From: Josh Graessley <email@hidden>)

  • Prev by Date: Re: Writing on a common socket from multiple threads
  • Next by Date: Re: Writing on a common socket from multiple threads
  • Previous by thread: Re: Writing on a common socket from multiple threads
  • Next by thread: Re: Writing on a common socket from multiple threads
  • Index(es):
    • Date
    • Thread