public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: poll function in cygwin
@ 2002-08-27  2:43 Nguyen Minh Sang
  2002-08-27  7:55 ` Christopher Faylor
  0 siblings, 1 reply; 10+ messages in thread
From: Nguyen Minh Sang @ 2002-08-27  2:43 UTC (permalink / raw)
  To: egor duda; +Cc: corinna-cygwin, cygwin

Hi !

  I has written a CHAT server that uses poll function. In linux, it's
OK. The concurrent connection I achieved is lager than 1024. But on
Win2k (compile in cygwin) then concurrent connection reach only 1023 and
the process bug: Segmentaion fault. could you help me to solve this
problem ?

Thanks and Best Regards,
sangnm.

-----Original Message-----
From: egor duda [ mailto:deo@logos-m.ru ]
Sent: Tuesday, August 27, 2002 2:27 AM
To: Corinna Vinschen
Subject: Re: poll function in cygwin


Hi!

Tuesday, 27 August, 2002 Corinna Vinschen corinna-cygwin@cygwin.com
wrote:

CV> On Tue, Aug 27, 2002 at 02:33:40PM +0700, Nguyen Minh Sang wrote:
>>    On cygwin, function:
>> int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
>> 
>> The maximum of nfds = ?

CV> Theoretically there is no maximum.  In practice the maximum is a
CV> function of the memory available.

I was thinking that maximum number of handles which can be waited via
WaitForMultipleObjects() is 64, thus limiting a number of handles that
can be select()ed. It's probably possible to work around such
limitation in cygwin select() but either i've missed something or no
such workaround was created in cygwin code. 

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  2:43 poll function in cygwin Nguyen Minh Sang
@ 2002-08-27  7:55 ` Christopher Faylor
  0 siblings, 0 replies; 10+ messages in thread
From: Christopher Faylor @ 2002-08-27  7:55 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 27, 2002 at 04:46:23PM +0700, Nguyen Minh Sang wrote:
>I has written a CHAT server that uses poll function.  In linux, it's
>OK.  The concurrent connection I achieved is lager than 1024.  But on
>Win2k (compile in cygwin) then concurrent connection reach only 1023
>and the process bug: Segmentaion fault.  could you help me to solve
>this problem ?

Why not solve it yourself?  Run it under the debugger.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27 19:36           ` Christopher Faylor
@ 2002-08-27 19:52             ` Robert Collins
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Collins @ 2002-08-27 19:52 UTC (permalink / raw)
  To: cygwin

On Wed, 2002-08-28 at 12:36, Christopher Faylor wrote:


> I was not asserting that WaitForMultipleObjects could wait for >64
> handles.  I was saying that cygwin's select() can do so.

Doh. Sorry. Here is me munching my words... munch munch munch.

Rob

-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9bDsMI5+kQ8LJcoIRAvm9AJ9s5ENtunSt1GK6SxarVHmZ83JBzgCgr0rB
WOPqRBN3GcM3qkzHWnkzOe8=
=XfUf
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27 18:58         ` Robert Collins
@ 2002-08-27 19:36           ` Christopher Faylor
  2002-08-27 19:52             ` Robert Collins
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher Faylor @ 2002-08-27 19:36 UTC (permalink / raw)
  To: cygwin

On Wed, Aug 28, 2002 at 11:58:20AM +1000, Robert Collins wrote:
>On Wed, 2002-08-28 at 00:54, Christopher Faylor wrote:
>>> >>I was thinking that maximum number of handles which can be waited via
>> >>WaitForMultipleObjects() is 64, thus limiting a number of handles that
>> >>can be select()ed.  It's probably possible to work around such
>> >>limitation in cygwin select() but either i've missed something or no
>> >>such workaround was created in cygwin code.
>> >
>> >Ahem, no, you're right.
>> 
>> Actually, it isn't that simple.  It depends on what you are waiting
>> for.  For instance, if you are waiting for pipes, you can wait for
>> an unlimited number of them.  If you ware waiting for sockets, I think
>> that is also true.  If you are waiting for console handles, then yes,
>> 64 is the maximum.
>
>According to MSDN, Egor is right. I wouldn't be surprised if MS allowed
>more 'silently' on new OS's though..

I was not asserting that WaitForMultipleObjects could wait for >64
handles.  I was saying that cygwin's select() can do so.

If you look at the code you might be able to see why this is so.  It's
not really worth debating however.  I just chimed in as the author of
the select code to make it clear that the issue isn't as simple as
saying that "Cygwin's select can only deal with 64 fds".  In most cases
it can handle many more than that.

cgf
(who will now probably get a lot of private email from people with select
"problems")

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  7:55       ` Christopher Faylor
@ 2002-08-27 18:58         ` Robert Collins
  2002-08-27 19:36           ` Christopher Faylor
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Collins @ 2002-08-27 18:58 UTC (permalink / raw)
  To: cygwin

On Wed, 2002-08-28 at 00:54, Christopher Faylor wrote:
>> >>I was thinking that maximum number of handles which can be waited via
> >>WaitForMultipleObjects() is 64, thus limiting a number of handles that
> >>can be select()ed.  It's probably possible to work around such
> >>limitation in cygwin select() but either i've missed something or no
> >>such workaround was created in cygwin code.
> >
> >Ahem, no, you're right.
> 
> Actually, it isn't that simple.  It depends on what you are waiting
> for.  For instance, if you are waiting for pipes, you can wait for
> an unlimited number of them.  If you ware waiting for sockets, I think
> that is also true.  If you are waiting for console handles, then yes,
> 64 is the maximum.

According to MSDN, Egor is right. I wouldn't be surprised if MS allowed
more 'silently' on new OS's though..

Rob

-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9bC48I5+kQ8LJcoIRAnQdAJ9Qu1XhtGLtF021Dfi5hJcfQgi+igCfWd4x
cy74hfwE87yaYH7+5jVVV3A=
=Ie7V
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  2:58     ` Corinna Vinschen
@ 2002-08-27  7:55       ` Christopher Faylor
  2002-08-27 18:58         ` Robert Collins
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher Faylor @ 2002-08-27  7:55 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 27, 2002 at 11:58:45AM +0200, Corinna Vinschen wrote:
>On Tue, Aug 27, 2002 at 01:27:03PM +0400, Egor Duda wrote:
>> Tuesday, 27 August, 2002 Corinna Vinschen corinna-cygwin@cygwin.com wrote:
>>CV> On Tue, Aug 27, 2002 at 02:33:40PM +0700, Nguyen Minh Sang wrote:
>>>>On cygwin, function: int poll(struct pollfd *ufds, unsigned int nfds,
>>>>int timeout);
>>>>
>>>>The maximum of nfds = ?
>>
>>CV> Theoretically there is no maximum.  In practice the maximum is a
>>CV> function of the memory available.
>>
>>I was thinking that maximum number of handles which can be waited via
>>WaitForMultipleObjects() is 64, thus limiting a number of handles that
>>can be select()ed.  It's probably possible to work around such
>>limitation in cygwin select() but either i've missed something or no
>>such workaround was created in cygwin code.
>
>Ahem, no, you're right.

Actually, it isn't that simple.  It depends on what you are waiting
for.  For instance, if you are waiting for pipes, you can wait for
an unlimited number of them.  If you ware waiting for sockets, I think
that is also true.  If you are waiting for console handles, then yes,
64 is the maximum.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  2:27   ` egor duda
@ 2002-08-27  2:58     ` Corinna Vinschen
  2002-08-27  7:55       ` Christopher Faylor
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2002-08-27  2:58 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 27, 2002 at 01:27:03PM +0400, Egor Duda wrote:
> Hi!
> 
> Tuesday, 27 August, 2002 Corinna Vinschen corinna-cygwin@cygwin.com wrote:
> 
> CV> On Tue, Aug 27, 2002 at 02:33:40PM +0700, Nguyen Minh Sang wrote:
> >>    On cygwin, function:
> >> int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
> >> 
> >> The maximum of nfds = ?
> 
> CV> Theoretically there is no maximum.  In practice the maximum is a
> CV> function of the memory available.
> 
> I was thinking that maximum number of handles which can be waited via
> WaitForMultipleObjects() is 64, thus limiting a number of handles that
> can be select()ed. It's probably possible to work around such
> limitation in cygwin select() but either i've missed something or no
> such workaround was created in cygwin code. 

Ahem, no, you're right.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  2:14 ` Corinna Vinschen
@ 2002-08-27  2:27   ` egor duda
  2002-08-27  2:58     ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: egor duda @ 2002-08-27  2:27 UTC (permalink / raw)
  To: Corinna Vinschen

Hi!

Tuesday, 27 August, 2002 Corinna Vinschen corinna-cygwin@cygwin.com wrote:

CV> On Tue, Aug 27, 2002 at 02:33:40PM +0700, Nguyen Minh Sang wrote:
>>    On cygwin, function:
>> int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
>> 
>> The maximum of nfds = ?

CV> Theoretically there is no maximum.  In practice the maximum is a
CV> function of the memory available.

I was thinking that maximum number of handles which can be waited via
WaitForMultipleObjects() is 64, thus limiting a number of handles that
can be select()ed. It's probably possible to work around such
limitation in cygwin select() but either i've missed something or no
such workaround was created in cygwin code. 

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: poll function in cygwin
  2002-08-27  0:29 Nguyen Minh Sang
@ 2002-08-27  2:14 ` Corinna Vinschen
  2002-08-27  2:27   ` egor duda
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2002-08-27  2:14 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 27, 2002 at 02:33:40PM +0700, Nguyen Minh Sang wrote:
> Hi All,
> 
>    On cygwin, function: 
> int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
> 
> The maximum of nfds = ?

Theoretically there is no maximum.  In practice the maximum is a
function of the memory available.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* poll function in cygwin
@ 2002-08-27  0:29 Nguyen Minh Sang
  2002-08-27  2:14 ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Nguyen Minh Sang @ 2002-08-27  0:29 UTC (permalink / raw)
  To: cygwin

Hi All,

   On cygwin, function: 
int poll(struct pollfd *ufds, unsigned int nfds, int timeout);

The maximum of nfds = ?

thanks,
sangnm.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-08-27 19:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27  2:43 poll function in cygwin Nguyen Minh Sang
2002-08-27  7:55 ` Christopher Faylor
  -- strict thread matches above, loose matches on Subject: below --
2002-08-27  0:29 Nguyen Minh Sang
2002-08-27  2:14 ` Corinna Vinschen
2002-08-27  2:27   ` egor duda
2002-08-27  2:58     ` Corinna Vinschen
2002-08-27  7:55       ` Christopher Faylor
2002-08-27 18:58         ` Robert Collins
2002-08-27 19:36           ` Christopher Faylor
2002-08-27 19:52             ` Robert Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).