Issue #4636 has been updated by Motohiro KOSAKI.

Status changed from Open to Closed

r31394-r31397 ???潟??????????х?眼?c?????????с??
----------------------------------------
Bug #4636: thread.c#do_select() ??? HAVE_RB_FD_INIT ???宴?若?鴻??罩c????????潟?????潟?違??????????
http://redmine.ruby-lang.org/issues/4636

Author: Motohiro KOSAKI
Status: Closed
Priority: Low
Assignee: Motohiro KOSAKI
Category: core
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-04-30 trunk 31387) [x86_64-linux]


=begin
?????c???羂???ャ????????ц儀腑???????????障??

do_select()???

    fd_set UNINITIALIZED_VAR(orig_read);
   ....
    if (read) orig_read = *read;

???????????????????障?????????????????????????????障????????c????????????????井??菴????BSD??????
http://netbsd.gw.com/cgi-bin/man-cgi?select++NetBSD-4.0

                  fd_set *fdsr;
                   int max = fd;

                   fdsr = (fd_set *)calloc(howmany(max+1, NFDBITS),
                       sizeof(fd_mask));
                   if (fdsr == NULL) {
                           ...
                           return (-1);
                   }
                   FD_SET(fd, fdsr);
                   n = select(max+1, fdsr, NULL, NULL, &tv);
                   ...
                   free(fdsr);

??帥??????????????????allocate?????????????у??????????????激??fd_set????臂????????紊с???????????????????????障?????????с??fd_set???*???dereference?????<???????<?с??????????吟???????障?障?ц???障?????c?????? NFILE limit???
????????????鴻????????篋冴??絨??????????с???????????

絲丞???????????thread.c ??? fd_set* 綣???違??c????????????????? rb_fd_set_t* ???
綏????帥????? rb_fd_copy() ??с?潟????若??????????????????????????????????????????с???????????

?????????違?篁ヤ????潟??????????ф祁??ャ?????????????с?????

 commit ae317b518c4dcbcbf0ed02bb9e6cd7513f0a34fe
 Author: ko1 <ko1 / b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
 Date:   Thu Feb 8 11:51:40 2007 +0000

    * thread.c: change GVL_UNLOCK_RANGE() arguments
      (adding ubf as 2nd argument).
    * thread.c: fix to use polling in select on cygwin and mswin32.
   (snip)

=end



-- 
http://redmine.ruby-lang.org