multiple threads doing poll() or select() on a single socket or pipe












20















What do POSIX and other standards say about the situation where multiple threads are doing poll() or select() calls on a single socket or pipe handle at the same time?



If any data arrives, does only one of the waiting threads get woken up or do all of the waiting threads get woken up?










share|improve this question





























    20















    What do POSIX and other standards say about the situation where multiple threads are doing poll() or select() calls on a single socket or pipe handle at the same time?



    If any data arrives, does only one of the waiting threads get woken up or do all of the waiting threads get woken up?










    share|improve this question



























      20












      20








      20


      3






      What do POSIX and other standards say about the situation where multiple threads are doing poll() or select() calls on a single socket or pipe handle at the same time?



      If any data arrives, does only one of the waiting threads get woken up or do all of the waiting threads get woken up?










      share|improve this question
















      What do POSIX and other standards say about the situation where multiple threads are doing poll() or select() calls on a single socket or pipe handle at the same time?



      If any data arrives, does only one of the waiting threads get woken up or do all of the waiting threads get woken up?







      multithreading sockets posix sus






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 19 '13 at 10:04









      sehe

      278k33341469




      278k33341469










      asked Sep 19 '13 at 9:51









      wilxwilx

      13.3k44290




      13.3k44290
























          3 Answers
          3






          active

          oldest

          votes


















          17





          +50









          Interesting question ... I read through the current POSIX and did not find a specific answer, i.e., no specification about concurrent invocations.
          So I'll explain why I think the standard means all will wake up.



          The relevant part of the text for select / pselect is:




          Upon successful completion, the pselect() or select() function shall modify the objects
          pointed to by the readfds, writefds, and errorfds arguments to indicate which file
          descriptors are ready for reading, ready for writing, or have an error condition pending,
          respectively, [...]




          and later




          A descriptor shall be considered ready for reading when a call to an input function with
          O_NONBLOCK clear would not block, whether or not the function would transfer data
          successfully. (The function might return data, an end-of-file indication, or an error
          other than one indicating that it is blocked, and in each of these cases the descriptor
          shall be considered ready for reading.)




          In short (the reading case only), we can understand this as:



          select does not block this means that the next call to an input function with O_NONBLOCK would not return an error with errno==EWOULDBLOCK. [Note that the "next" is my interpretation of the above.]



          If one admits to this interpretation then two concurrent select calls could both return the same FD as readable. In fact even if they are not concurrent, but a first thread calls select with some FD being readable and later e.g., read, a second thread calling select between the two could return the FD as readable for the second thread.



          Now the relevant part for the "waking up" part of the question is this:




          If none of the selected descriptors are ready for the requested operation, the pselect()
          or select() function shall block until at least one of the requested operations becomes
          ready, until the timeout occurs, or until interrupted by a signal.




          Here clearly the above interpretation suggests that concurrently waiting calls will all return.






          share|improve this answer


























          • Thank you for your exhaustive answer. I wish the standard were more clear about this.

            – wilx
            Sep 25 '13 at 18:56











          • Indeed, one would wish so.

            – subsub
            Sep 25 '13 at 19:24



















          4














          I just found a bug because of this question:
          I have two threads selecting on the same socket, and will call accept when the fd comes back as isset(). In fact the select comes back for both threads, the fd isset() for that fd in both threads, and both threads call accept(), one wins and the other blocks waiting for another connection to come in.



          So in fact select will return in all threads that it is blocking on for the same fd.






          share|improve this answer
























          • This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

            – Nick
            Feb 23 '17 at 22:36






          • 3





            Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

            – stu
            Feb 24 '17 at 14:14



















          2














          They should all wake up, all return the same result value, and all all do the same thing to the FD sets. They are all asking the same question, so they should all get the same answer.



          What select() is supposed to do, according to the POSIX documentation which has been cited here, and my mere 25 years' exerience with it, is to return the number of FDs that are readable, writable, etc., at that instant. It would therefore be completely incorrect for all the concurrent select() calls not to all return the same thing.



          The select() function can't predict the future, i.e. which thread is actually going to do a read or write, and therefore which thread will succeed in that. They contend. It's a thundering-herd problem.






          share|improve this answer





















          • 1





            Since you have no intention to answering the question, why did't you make this a comment?

            – sehe
            Sep 19 '13 at 10:05











          • @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

            – wilx
            Sep 19 '13 at 10:06











          • @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

            – user207421
            Sep 19 '13 at 10:09











          • @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

            – user207421
            Sep 19 '13 at 10:09








          • 4





            Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

            – nos
            Sep 19 '13 at 10:17













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18891500%2fmultiple-threads-doing-poll-or-select-on-a-single-socket-or-pipe%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          17





          +50









          Interesting question ... I read through the current POSIX and did not find a specific answer, i.e., no specification about concurrent invocations.
          So I'll explain why I think the standard means all will wake up.



          The relevant part of the text for select / pselect is:




          Upon successful completion, the pselect() or select() function shall modify the objects
          pointed to by the readfds, writefds, and errorfds arguments to indicate which file
          descriptors are ready for reading, ready for writing, or have an error condition pending,
          respectively, [...]




          and later




          A descriptor shall be considered ready for reading when a call to an input function with
          O_NONBLOCK clear would not block, whether or not the function would transfer data
          successfully. (The function might return data, an end-of-file indication, or an error
          other than one indicating that it is blocked, and in each of these cases the descriptor
          shall be considered ready for reading.)




          In short (the reading case only), we can understand this as:



          select does not block this means that the next call to an input function with O_NONBLOCK would not return an error with errno==EWOULDBLOCK. [Note that the "next" is my interpretation of the above.]



          If one admits to this interpretation then two concurrent select calls could both return the same FD as readable. In fact even if they are not concurrent, but a first thread calls select with some FD being readable and later e.g., read, a second thread calling select between the two could return the FD as readable for the second thread.



          Now the relevant part for the "waking up" part of the question is this:




          If none of the selected descriptors are ready for the requested operation, the pselect()
          or select() function shall block until at least one of the requested operations becomes
          ready, until the timeout occurs, or until interrupted by a signal.




          Here clearly the above interpretation suggests that concurrently waiting calls will all return.






          share|improve this answer


























          • Thank you for your exhaustive answer. I wish the standard were more clear about this.

            – wilx
            Sep 25 '13 at 18:56











          • Indeed, one would wish so.

            – subsub
            Sep 25 '13 at 19:24
















          17





          +50









          Interesting question ... I read through the current POSIX and did not find a specific answer, i.e., no specification about concurrent invocations.
          So I'll explain why I think the standard means all will wake up.



          The relevant part of the text for select / pselect is:




          Upon successful completion, the pselect() or select() function shall modify the objects
          pointed to by the readfds, writefds, and errorfds arguments to indicate which file
          descriptors are ready for reading, ready for writing, or have an error condition pending,
          respectively, [...]




          and later




          A descriptor shall be considered ready for reading when a call to an input function with
          O_NONBLOCK clear would not block, whether or not the function would transfer data
          successfully. (The function might return data, an end-of-file indication, or an error
          other than one indicating that it is blocked, and in each of these cases the descriptor
          shall be considered ready for reading.)




          In short (the reading case only), we can understand this as:



          select does not block this means that the next call to an input function with O_NONBLOCK would not return an error with errno==EWOULDBLOCK. [Note that the "next" is my interpretation of the above.]



          If one admits to this interpretation then two concurrent select calls could both return the same FD as readable. In fact even if they are not concurrent, but a first thread calls select with some FD being readable and later e.g., read, a second thread calling select between the two could return the FD as readable for the second thread.



          Now the relevant part for the "waking up" part of the question is this:




          If none of the selected descriptors are ready for the requested operation, the pselect()
          or select() function shall block until at least one of the requested operations becomes
          ready, until the timeout occurs, or until interrupted by a signal.




          Here clearly the above interpretation suggests that concurrently waiting calls will all return.






          share|improve this answer


























          • Thank you for your exhaustive answer. I wish the standard were more clear about this.

            – wilx
            Sep 25 '13 at 18:56











          • Indeed, one would wish so.

            – subsub
            Sep 25 '13 at 19:24














          17





          +50







          17





          +50



          17




          +50





          Interesting question ... I read through the current POSIX and did not find a specific answer, i.e., no specification about concurrent invocations.
          So I'll explain why I think the standard means all will wake up.



          The relevant part of the text for select / pselect is:




          Upon successful completion, the pselect() or select() function shall modify the objects
          pointed to by the readfds, writefds, and errorfds arguments to indicate which file
          descriptors are ready for reading, ready for writing, or have an error condition pending,
          respectively, [...]




          and later




          A descriptor shall be considered ready for reading when a call to an input function with
          O_NONBLOCK clear would not block, whether or not the function would transfer data
          successfully. (The function might return data, an end-of-file indication, or an error
          other than one indicating that it is blocked, and in each of these cases the descriptor
          shall be considered ready for reading.)




          In short (the reading case only), we can understand this as:



          select does not block this means that the next call to an input function with O_NONBLOCK would not return an error with errno==EWOULDBLOCK. [Note that the "next" is my interpretation of the above.]



          If one admits to this interpretation then two concurrent select calls could both return the same FD as readable. In fact even if they are not concurrent, but a first thread calls select with some FD being readable and later e.g., read, a second thread calling select between the two could return the FD as readable for the second thread.



          Now the relevant part for the "waking up" part of the question is this:




          If none of the selected descriptors are ready for the requested operation, the pselect()
          or select() function shall block until at least one of the requested operations becomes
          ready, until the timeout occurs, or until interrupted by a signal.




          Here clearly the above interpretation suggests that concurrently waiting calls will all return.






          share|improve this answer















          Interesting question ... I read through the current POSIX and did not find a specific answer, i.e., no specification about concurrent invocations.
          So I'll explain why I think the standard means all will wake up.



          The relevant part of the text for select / pselect is:




          Upon successful completion, the pselect() or select() function shall modify the objects
          pointed to by the readfds, writefds, and errorfds arguments to indicate which file
          descriptors are ready for reading, ready for writing, or have an error condition pending,
          respectively, [...]




          and later




          A descriptor shall be considered ready for reading when a call to an input function with
          O_NONBLOCK clear would not block, whether or not the function would transfer data
          successfully. (The function might return data, an end-of-file indication, or an error
          other than one indicating that it is blocked, and in each of these cases the descriptor
          shall be considered ready for reading.)




          In short (the reading case only), we can understand this as:



          select does not block this means that the next call to an input function with O_NONBLOCK would not return an error with errno==EWOULDBLOCK. [Note that the "next" is my interpretation of the above.]



          If one admits to this interpretation then two concurrent select calls could both return the same FD as readable. In fact even if they are not concurrent, but a first thread calls select with some FD being readable and later e.g., read, a second thread calling select between the two could return the FD as readable for the second thread.



          Now the relevant part for the "waking up" part of the question is this:




          If none of the selected descriptors are ready for the requested operation, the pselect()
          or select() function shall block until at least one of the requested operations becomes
          ready, until the timeout occurs, or until interrupted by a signal.




          Here clearly the above interpretation suggests that concurrently waiting calls will all return.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 24 '17 at 8:51









          wilx

          13.3k44290




          13.3k44290










          answered Sep 24 '13 at 14:08









          subsubsubsub

          1,693820




          1,693820













          • Thank you for your exhaustive answer. I wish the standard were more clear about this.

            – wilx
            Sep 25 '13 at 18:56











          • Indeed, one would wish so.

            – subsub
            Sep 25 '13 at 19:24



















          • Thank you for your exhaustive answer. I wish the standard were more clear about this.

            – wilx
            Sep 25 '13 at 18:56











          • Indeed, one would wish so.

            – subsub
            Sep 25 '13 at 19:24

















          Thank you for your exhaustive answer. I wish the standard were more clear about this.

          – wilx
          Sep 25 '13 at 18:56





          Thank you for your exhaustive answer. I wish the standard were more clear about this.

          – wilx
          Sep 25 '13 at 18:56













          Indeed, one would wish so.

          – subsub
          Sep 25 '13 at 19:24





          Indeed, one would wish so.

          – subsub
          Sep 25 '13 at 19:24













          4














          I just found a bug because of this question:
          I have two threads selecting on the same socket, and will call accept when the fd comes back as isset(). In fact the select comes back for both threads, the fd isset() for that fd in both threads, and both threads call accept(), one wins and the other blocks waiting for another connection to come in.



          So in fact select will return in all threads that it is blocking on for the same fd.






          share|improve this answer
























          • This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

            – Nick
            Feb 23 '17 at 22:36






          • 3





            Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

            – stu
            Feb 24 '17 at 14:14
















          4














          I just found a bug because of this question:
          I have two threads selecting on the same socket, and will call accept when the fd comes back as isset(). In fact the select comes back for both threads, the fd isset() for that fd in both threads, and both threads call accept(), one wins and the other blocks waiting for another connection to come in.



          So in fact select will return in all threads that it is blocking on for the same fd.






          share|improve this answer
























          • This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

            – Nick
            Feb 23 '17 at 22:36






          • 3





            Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

            – stu
            Feb 24 '17 at 14:14














          4












          4








          4







          I just found a bug because of this question:
          I have two threads selecting on the same socket, and will call accept when the fd comes back as isset(). In fact the select comes back for both threads, the fd isset() for that fd in both threads, and both threads call accept(), one wins and the other blocks waiting for another connection to come in.



          So in fact select will return in all threads that it is blocking on for the same fd.






          share|improve this answer













          I just found a bug because of this question:
          I have two threads selecting on the same socket, and will call accept when the fd comes back as isset(). In fact the select comes back for both threads, the fd isset() for that fd in both threads, and both threads call accept(), one wins and the other blocks waiting for another connection to come in.



          So in fact select will return in all threads that it is blocking on for the same fd.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 25 '16 at 14:49









          stustu

          3,864155886




          3,864155886













          • This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

            – Nick
            Feb 23 '17 at 22:36






          • 3





            Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

            – stu
            Feb 24 '17 at 14:14



















          • This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

            – Nick
            Feb 23 '17 at 22:36






          • 3





            Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

            – stu
            Feb 24 '17 at 14:14

















          This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

          – Nick
          Feb 23 '17 at 22:36





          This surely isn't surprising. For example, thread A might come off the select() and then before it has a chance to call accept(), thread B may be scheduled to run and come off select() for the same reason as the descriptor is in the same state. Thus you now have both threads about to call accept(). You should always assume that there will be an infinitely large amount of time between one piece of code running and the next, keep in mind that any other process or thread might run during that time, and whether doing so could be a problem for your code.

          – Nick
          Feb 23 '17 at 22:36




          3




          3





          Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

          – stu
          Feb 24 '17 at 14:14





          Gravity isn't surprising if you know how it works. But newton found it surprising. :-)

          – stu
          Feb 24 '17 at 14:14











          2














          They should all wake up, all return the same result value, and all all do the same thing to the FD sets. They are all asking the same question, so they should all get the same answer.



          What select() is supposed to do, according to the POSIX documentation which has been cited here, and my mere 25 years' exerience with it, is to return the number of FDs that are readable, writable, etc., at that instant. It would therefore be completely incorrect for all the concurrent select() calls not to all return the same thing.



          The select() function can't predict the future, i.e. which thread is actually going to do a read or write, and therefore which thread will succeed in that. They contend. It's a thundering-herd problem.






          share|improve this answer





















          • 1





            Since you have no intention to answering the question, why did't you make this a comment?

            – sehe
            Sep 19 '13 at 10:05











          • @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

            – wilx
            Sep 19 '13 at 10:06











          • @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

            – user207421
            Sep 19 '13 at 10:09











          • @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

            – user207421
            Sep 19 '13 at 10:09








          • 4





            Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

            – nos
            Sep 19 '13 at 10:17


















          2














          They should all wake up, all return the same result value, and all all do the same thing to the FD sets. They are all asking the same question, so they should all get the same answer.



          What select() is supposed to do, according to the POSIX documentation which has been cited here, and my mere 25 years' exerience with it, is to return the number of FDs that are readable, writable, etc., at that instant. It would therefore be completely incorrect for all the concurrent select() calls not to all return the same thing.



          The select() function can't predict the future, i.e. which thread is actually going to do a read or write, and therefore which thread will succeed in that. They contend. It's a thundering-herd problem.






          share|improve this answer





















          • 1





            Since you have no intention to answering the question, why did't you make this a comment?

            – sehe
            Sep 19 '13 at 10:05











          • @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

            – wilx
            Sep 19 '13 at 10:06











          • @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

            – user207421
            Sep 19 '13 at 10:09











          • @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

            – user207421
            Sep 19 '13 at 10:09








          • 4





            Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

            – nos
            Sep 19 '13 at 10:17
















          2












          2








          2







          They should all wake up, all return the same result value, and all all do the same thing to the FD sets. They are all asking the same question, so they should all get the same answer.



          What select() is supposed to do, according to the POSIX documentation which has been cited here, and my mere 25 years' exerience with it, is to return the number of FDs that are readable, writable, etc., at that instant. It would therefore be completely incorrect for all the concurrent select() calls not to all return the same thing.



          The select() function can't predict the future, i.e. which thread is actually going to do a read or write, and therefore which thread will succeed in that. They contend. It's a thundering-herd problem.






          share|improve this answer















          They should all wake up, all return the same result value, and all all do the same thing to the FD sets. They are all asking the same question, so they should all get the same answer.



          What select() is supposed to do, according to the POSIX documentation which has been cited here, and my mere 25 years' exerience with it, is to return the number of FDs that are readable, writable, etc., at that instant. It would therefore be completely incorrect for all the concurrent select() calls not to all return the same thing.



          The select() function can't predict the future, i.e. which thread is actually going to do a read or write, and therefore which thread will succeed in that. They contend. It's a thundering-herd problem.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 10 '15 at 5:03

























          answered Sep 19 '13 at 10:03









          user207421user207421

          263k25212361




          263k25212361








          • 1





            Since you have no intention to answering the question, why did't you make this a comment?

            – sehe
            Sep 19 '13 at 10:05











          • @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

            – wilx
            Sep 19 '13 at 10:06











          • @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

            – user207421
            Sep 19 '13 at 10:09











          • @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

            – user207421
            Sep 19 '13 at 10:09








          • 4





            Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

            – nos
            Sep 19 '13 at 10:17
















          • 1





            Since you have no intention to answering the question, why did't you make this a comment?

            – sehe
            Sep 19 '13 at 10:05











          • @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

            – wilx
            Sep 19 '13 at 10:06











          • @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

            – user207421
            Sep 19 '13 at 10:09











          • @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

            – user207421
            Sep 19 '13 at 10:09








          • 4





            Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

            – nos
            Sep 19 '13 at 10:17










          1




          1





          Since you have no intention to answering the question, why did't you make this a comment?

          – sehe
          Sep 19 '13 at 10:05





          Since you have no intention to answering the question, why did't you make this a comment?

          – sehe
          Sep 19 '13 at 10:05













          @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

          – wilx
          Sep 19 '13 at 10:06





          @EJP: Me testing on, say, Linux does not say anything about, say, HP-UX. I want some reasoned answer, not an empiric test, if I can have it.

          – wilx
          Sep 19 '13 at 10:06













          @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

          – user207421
          Sep 19 '13 at 10:09





          @sehe It seems to me that I have answered the question actually, so the second part of your question is a non sequitur.

          – user207421
          Sep 19 '13 at 10:09













          @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

          – user207421
          Sep 19 '13 at 10:09







          @wilx This is a 'reasoned answer'. Clearly there is no pleasing everybody. One person considers a reasoned answer not to be an answer at all, and another doesn't recognize a reasoned answer when he sees it.

          – user207421
          Sep 19 '13 at 10:09






          4




          4





          Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

          – nos
          Sep 19 '13 at 10:17







          Well the question asks what posix says. If posix doesn't really say anything, any observed behavior on a platform could be purely accidental - unless that particular platform has it's own guarantees about how this is handled.

          – nos
          Sep 19 '13 at 10:17




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18891500%2fmultiple-threads-doing-poll-or-select-on-a-single-socket-or-pipe%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Vorschmack

          Quarantine