Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Does IO::Select work? (Problem partially resolved)

by BrowserUk (Pope)
on Oct 22, 2012 at 08:18 UTC ( #1000287=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Does IO::Select work? (Problem partially resolved)
in thread Does IO::Select work? Anywhere?

Are you sure about this?

Yes. Pretty sure.

I've never programmed under Windows,

Don't write this off as a "windows problem".

but under Linux I haven't seen yet any single case when the file descriptor would be closed by the kernel.

You may not have, but others have:

Platform: osname=linux, osvers=2.6.24-27-server, archname=i486-linux-gnu-thread +-multi uname='linux vernadsky 2.6.24-27-server #1 smp fri mar 12 01:45:06 ut +c 2010 i686 gnulinux '
As to example, I've never used IO::Select module, but many years ago I've created more or less simple module that uses "select" directly. This module still works for many of my application, even though I consider it to be very poor. You can get it at http://vandal.sdf-eu.org/NetHandling.pm if you want.

Thanks for teh offer, but the way I eventually stopped writing off my long term lack of success with IO::Select as "user error" was by re-implementing (most) of the API without reference to the module source:

I guess the main reason why one can't find good examples of using "select" is just the fact, that it is not that simple.

Maybe, but wrapping over some of the low-level nitty-gritty in an IO:Select-type module certainly makes it easier.

But if there has been a latent bug in that module for the last 12 or more years that prevented people's attempts from working, it would have had a significant effect upon the availability of good examples.

And given that there are plenty of examples of many other things that are at least as complex, I find that a pretty persuasive argument for that inhibitory effect.

I've never really needed to use select for serious work -- I find threading far simpler, more intuitive and more powerful -- on windows at least -- so my previous attempts have been half-hearted -- usually with a view to demonstrating the virtues of threading over the select model -- and so I never had any real incentive to work past the problems.

Now I have understood the problem that has dogged my attempts for years, I feel the need to write a (pair of) full-featured servers. In part so I know I have done so. In part to allow me to make the real-world comparisons and measurements that will test my gut feel hypothesis about the relative merits of the two approaches.

Watch this space. (But don't hold your breath :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^3: Does IO::Select work? (Problem partially resolved)
Select or Download Code
Re^4: Does IO::Select work? (Problem partially resolved)
by andal (Friar) on Oct 22, 2012 at 09:06 UTC
    You may not have, but others have

    Just to clarify things a little. The page you have referenced, does not provide any specific example where the file descriptor would be closed by something other than the program itself. And I dare to say, that Linux kernel never closes handles opened by application unless application requests it. I don't believe perl would do it either. If you know about such place in perl, please point it out, so that I could avoid this swampy area in the future.

    I don't know how the things are done on Windows. But really, if Windows kernel closes your handles behind your back, then it is another reason for me not to use it :) It's a joke of course. But practical outcome is then, that IO::Select is not usable on Windows, but it shouldn't introduce any problems on Linux, as long as the user does the right thing. IMHO.

      The page you have referenced, does not provide any specific example

      Okay. He made it up; p5p accepted and patched it, just to appease him; and your glorious Linux is perfect.

      if Windows kernel closes your handles behind your back, then it is another reason for me not to use it :) It's a joke of course.

      There is a joke there all right.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-08-01 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls