All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tervel Atanassov" <noxidog@earthlink.net>
To: "'John Myers'" <jgmyers@netscape.com>,
	"'Charles 'Buck' Krasic'" <krasic@acm.org>
Cc: "'Davide Libenzi'" <davidel@xmailserver.org>,
	"'Benjamin LaHaise'" <bcrl@redhat.com>,
	"'Dan Kegel'" <dank@kegel.com>,
	"'Shailabh Nagar'" <nagar@watson.ibm.com>,
	"'linux-kernel'" <linux-kernel@vger.kernel.org>,
	"'linux-aio'" <linux-aio@kvack.org>,
	"'Andrew Morton'" <akpm@digeo.com>,
	"'David Miller'" <davem@redhat.com>,
	"'Linus Torvalds'" <torvalds@transmeta.com>,
	"'Stephen Tweedie'" <sct@redhat.com>
Subject: RE: epoll (was Re: [PATCH] async poll for 2.5)
Date: Fri, 18 Oct 2002 18:27:34 -0700	[thread overview]
Message-ID: <005c01c2770e$ba9cf050$0e00000a@turchodog> (raw)
In-Reply-To: <3DB0AFCE.5030205@netscape.com>

I am just joining your discussion today for the fist time.  I come from
a Windows implementation of async I/O, so please don't hold it against
me.  I can't say that I am following 100% percent, but I think you guys
are talking about what the user API will look like, correct?

Assuming the answer is yes.  Here are my two cents.  The code you have
below seems a bit awkward -- the line while(do_io(fd) != EAGAIN) appears
twice.  I think the reason for that is that you're trying to do too many
things at once, namely, you're trying to handle both the initial
accept/setup of the socket and its steady state servicing.  I don't see
any benefit to that -- it definitely doesn't make for cleaner code.  Why
not do things separately.

1.  Have a setup phase which more or less does:

*  listen()
*  accept()
*  add the new fd/socket to an "event" which all the worker threads are
waiting on.

2.  Have the worker tread/steady state operation be:

*  event_wait() which returns the fd, some descriptor of what exactly
happened (read/write), the number of bytes transferred.
*  based upon the return from event wait the user updates his state, and
posts the next operation (read/write).

Thanks,

Tervel Atanassov

-----Original Message-----
From: owner-linux-aio@kvack.org [mailto:owner-linux-aio@kvack.org] On
Behalf Of John Myers
Sent: Friday, October 18, 2002 6:05 PM
To: Charles 'Buck' Krasic
Cc: Davide Libenzi; Benjamin LaHaise; Dan Kegel; Shailabh Nagar;
linux-kernel; linux-aio; Andrew Morton; David Miller; Linus Torvalds;
Stephen Tweedie
Subject: Re: epoll (was Re: [PATCH] async poll for 2.5)

Charles 'Buck' Krasic wrote:

>Or we could have (to make John happier?):
>
>1 for(;;) {
>2      fd = event_wait(...);
>3      if(fd == my_listen_fd) {
>4           /* new connections */
>5           while((new_fd = my_accept(my_listen_fd, ...) != EAGAIN)) {
>6*                  epoll_addf(new_fd, &pfd, ...);
>7*                  if(pfd.revents & POLLIN) {
>7*                      while(do_io(new_fd) != EAGAIN);
>8*                  } 
>8           }
>9       } else {
>10           /* established connections */
>11           while(do_io(fd) != EAGAIN)
>12      }
>13 }
>  
>
Close.  What we would have is a modification of the epoll_addf() 
semantics such that it would have an additional postcondition that if 
the new_fd is in the ready state (has data available) then at least one 
notification has been generated.  In the code above, the three lines 
comprising the if statement labeled "7*" would be removed.


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/


  reply	other threads:[~2002-10-19  1:21 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 22:36 [PATCH] async poll for 2.5 Shailabh Nagar
2002-10-14 22:54 ` John Myers
2002-10-15 15:05 ` Benjamin LaHaise
2002-10-15 17:06   ` Dan Kegel
2002-10-15 17:03     ` Benjamin LaHaise
2002-10-15 17:18       ` Dan Kegel
2002-10-16  2:11         ` Lincoln Dale
2002-10-15 18:09     ` Shailabh Nagar
2002-10-15 18:53       ` Dan Kegel
2002-10-15 18:57         ` Benjamin LaHaise
2002-10-15 20:25           ` John Gardiner Myers
2002-10-15 21:09             ` Dan Kegel
2002-10-15 21:50               ` John Myers
2002-10-15 22:33                 ` Davide Libenzi
2002-10-15 22:56                   ` John Gardiner Myers
2002-10-15 23:23                     ` Davide Libenzi
2002-10-16 19:16                       ` John Myers
2002-10-15 21:11             ` Davide Libenzi
2002-10-15 22:01               ` John Gardiner Myers
2002-10-15 22:27                 ` Davide Libenzi
2002-10-15 22:36                   ` John Gardiner Myers
2002-10-15 22:41                     ` Benjamin LaHaise
2002-10-15 23:26                       ` John Gardiner Myers
2002-10-15 23:05                     ` Davide Libenzi
2002-10-15 23:33                       ` John Gardiner Myers
2002-10-16  0:05                         ` Davide Libenzi
2002-10-16  0:15                           ` John Myers
2002-10-16 14:25                             ` Davide Libenzi
2002-10-16 18:15                               ` John Gardiner Myers
2002-10-16 19:20                                 ` Davide Libenzi
2002-10-16 23:31                                   ` epoll (was Re: [PATCH] async poll for 2.5) John Gardiner Myers
2002-10-16 23:51                                     ` Davide Libenzi
2002-10-17 18:06                                       ` John Gardiner Myers
2002-10-17 18:33                                         ` Davide Libenzi
2002-10-18 19:02                                           ` John Gardiner Myers
2002-10-18 19:52                                             ` Davide Libenzi
2002-10-19  0:55                                               ` John Myers
2002-10-19  5:40                                                 ` Davide Libenzi
2002-10-19  6:59                                                 ` Mark Mielke
2002-10-19 17:26                                                   ` Davide Libenzi
2002-10-19 17:48                                                   ` Dan Kegel
2002-10-19 18:52                                                     ` Charles 'Buck' Krasic
2002-10-19 20:18                                                       ` Charles 'Buck' Krasic
2002-10-19 21:08                                                         ` Dan Kegel
2002-10-22 19:35                                               ` John Gardiner Myers
2002-10-22 20:06                                                 ` Davide Libenzi
2002-10-22 21:54                                                   ` Erich Nahum
2002-10-22 22:17                                                     ` Dan Kegel
2002-10-22 22:25                                                     ` Davide Libenzi
2002-10-18 21:01                                             ` Charles 'Buck' Krasic
2002-10-18 21:33                                               ` Davide Libenzi
2002-10-19  1:05                                           ` John Myers
2002-10-19  1:27                                             ` Tervel Atanassov [this message]
2002-10-19 18:52                                               ` John G. Myers
2002-10-19  4:07                                             ` Charles 'Buck' Krasic
2002-10-16 20:06                                 ` [PATCH] async poll for 2.5 Mark Mielke
2002-10-16 23:48                                   ` epoll (was Re: [PATCH] async poll for 2.5) John Gardiner Myers
2002-10-17  0:23                                     ` Davide Libenzi
2002-10-17 17:45                                       ` John Myers
2002-10-16  2:45                         ` [PATCH] async poll for 2.5 Charles 'Buck' Krasic
2002-10-16 14:28                           ` Davide Libenzi
2002-10-17 18:47                             ` Charles 'Buck' Krasic
2002-10-17 19:20                               ` Davide Libenzi
2002-10-18  3:30                               ` Dan Kegel
2002-10-16 18:29                           ` John Gardiner Myers
2002-10-16 20:39                             ` Charles 'Buck' Krasic
2002-10-17 17:59                               ` epoll (was Re: [PATCH] async poll for 2.5) John Gardiner Myers
2002-10-21 16:58                             ` [PATCH] async poll for 2.5 Alan Cox
2002-10-21 16:50                               ` Benjamin LaHaise
2002-10-16 19:59                     ` Dan Kegel
2002-10-16 20:03                 ` Dan Kegel
2002-10-17 17:43                   ` epoll (was Re: [PATCH] async poll for 2.5) John Myers
2002-10-18 17:00                     ` Mark Mielke
2002-10-18 17:28                       ` Dan Kegel
2002-10-18 17:41                         ` Davide Libenzi
2002-10-18 18:55                           ` Mark Mielke
2002-10-18 19:16                             ` Davide Libenzi
2002-10-19  6:56                               ` Mark Mielke
2002-10-19 16:10                                 ` Charles 'Buck' Krasic
2002-10-22 17:22                                   ` Mark Mielke
2002-10-22 17:46                                     ` Dan Kegel
2002-10-22 17:47                                     ` Davide Libenzi
2002-10-22 18:13                                       ` Alan Cox
2002-10-22 18:18                                         ` Davide Libenzi
2002-10-22 18:37                                           ` Benjamin LaHaise
2002-10-22 19:49                                             ` Davide Libenzi
2002-10-22 19:22                                         ` John Gardiner Myers
2002-10-22 19:28                                           ` Benjamin LaHaise
2002-10-22 19:50                                         ` John Gardiner Myers
2002-10-22 20:00                                           ` Benjamin LaHaise
2002-10-23 11:10                                             ` Latest aio code " Suparna Bhattacharya
2002-10-22 20:23                                         ` async poll John Myers
2002-10-22 18:42                                     ` epoll (was Re: [PATCH] async poll for 2.5) Charles 'Buck' Krasic
2002-10-22 19:35                                       ` Davide Libenzi
2002-10-23 16:49                                         ` Dan Kegel
2002-10-23 17:39                                           ` Benjamin LaHaise
2002-10-23 18:47                                             ` Davide Libenzi
2002-10-23 21:18                                               ` Benjamin LaHaise
2002-10-23 21:35                                                 ` Davide Libenzi
2002-10-23 21:39                                                   ` John Gardiner Myers
2002-10-23 21:54                                                     ` Davide Libenzi
2002-10-23 17:49                                           ` Charles 'Buck' Krasic
2002-10-23 18:14                                             ` Davide Libenzi
2002-10-23 18:32                                               ` Charles 'Buck' Krasic
2002-10-23 20:36                                               ` async poll John Myers
2002-10-23 20:57                                                 ` Dan Kegel
2002-10-23 21:13                                                 ` Charles 'Buck' Krasic
2002-10-23 21:23                                               ` John Gardiner Myers
2002-10-23 21:51                                                 ` Davide Libenzi
2002-10-23 21:51                                                   ` bert hubert
2002-10-23 22:10                                                     ` Davide Libenzi
2002-10-23 21:54                                                   ` John Gardiner Myers
2002-10-23 22:22                                                     ` Davide Libenzi
2002-10-23 22:29                                                       ` John Gardiner Myers
2002-10-23 22:50                                                         ` Davide Libenzi
2002-10-24  7:32                                                           ` Eduardo Pérez
2002-10-24 15:05                                                             ` Charles 'Buck' Krasic
2002-10-23 22:24                                                 ` Dan Kegel
2002-10-23 22:30                                                   ` Davide Libenzi
2002-10-23 22:53                                                     ` Davide Libenzi
2002-10-19 17:19                                 ` epoll (was Re: [PATCH] async poll for 2.5) Davide Libenzi
2002-10-18 18:55                       ` Chris Friesen
2002-10-18 19:00                         ` Mark Mielke
2002-10-15 17:38   ` [PATCH] async poll for 2.5 Shailabh Nagar
2002-10-15 17:50     ` Benjamin LaHaise
2002-10-15 18:16       ` Davide Libenzi
2002-10-15 18:18         ` Shailabh Nagar
2002-10-15 19:00           ` Davide Libenzi
2002-10-15 19:02             ` Benjamin LaHaise
2002-10-15 18:59               ` Shailabh Nagar
2002-10-15 19:16               ` Davide Libenzi
2002-10-15 19:12                 ` Benjamin LaHaise
2002-10-15 19:31                   ` Davide Libenzi
2002-10-15 19:38                     ` Dan Kegel
2002-10-15 19:55                       ` Davide Libenzi
2002-10-15 20:36                   ` John Gardiner Myers
2002-10-15 20:39                     ` Benjamin LaHaise
2002-10-15 19:02           ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005c01c2770e$ba9cf050$0e00000a@turchodog' \
    --to=noxidog@earthlink.net \
    --cc=akpm@digeo.com \
    --cc=bcrl@redhat.com \
    --cc=dank@kegel.com \
    --cc=davem@redhat.com \
    --cc=davidel@xmailserver.org \
    --cc=jgmyers@netscape.com \
    --cc=krasic@acm.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nagar@watson.ibm.com \
    --cc=sct@redhat.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.