Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38392

Re: select.epoll question

From Kushal Kumaran <kushal.kumaran+python@gmail.com>
Subject Re: select.epoll question
References <7xbobw1tzr.fsf@ruckus.brouhaha.com> <mailman.1447.1360241349.2939.python-list@python.org> <7x1ucs2j8m.fsf@ruckus.brouhaha.com> <mailman.1452.1360254273.2939.python-list@python.org> <7xliazq3ky.fsf@ruckus.brouhaha.com>
Date 2013-02-08 07:36 +0530
Newsgroups comp.lang.python
Message-ID <mailman.1467.1360289225.2939.python-list@python.org> (permalink)

Show all headers | View raw


Paul Rubin <no.email@nospam.invalid> writes:

> Chris Angelico <rosuav@gmail.com> writes:
>> Yeah, I figured fileno() probably wouldn't be news to you. I don't
>> suppose there's anything convenient in the rest of your application
>> that makes such a list/dict plausible? 
>
> In fact it's rather annoying, sockets are created and destroyed in
> multiple places in the program.  I have to be careful about leaking them
> in case a thread crashes, etc.  I dealt with the poll issue by manually
> tracking what was happening, but it wasn't pretty, so I wondered if
> there was a better solution I was overlooking.  I don't want to mess
> with it too much more since I'm planning a completely different approach
> for the next version of the program.

You don't have to maintain the mapping globally.  You could wrap
socket.epoll in a class of your own that manages the mapping, and passes
through calls to socket.epoll.  That would make the wrapper a drop-in
replacement for socket.epoll.

-- 
regards,
kushal

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-06 23:08 -0800
  Re: select.epoll question Chris Angelico <rosuav@gmail.com> - 2013-02-07 23:49 +1100
    Re: select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-07 08:15 -0800
      Re: select.epoll question Chris Angelico <rosuav@gmail.com> - 2013-02-08 03:24 +1100
        Re: select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-07 12:19 -0800
          Re: select.epoll question Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2013-02-08 07:36 +0530

csiph-web