ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.70 by root, Tue Oct 24 15:15:56 2006 UTC vs.
Revision 1.74 by root, Wed Oct 25 17:57:30 2006 UTC

59 59
60/* buffer size for various temporary buffers */ 60/* buffer size for various temporary buffers */
61#define AIO_BUFSIZE 65536 61#define AIO_BUFSIZE 65536
62 62
63#define dBUF \ 63#define dBUF \
64 char *aio_buf; \
65 LOCK (wrklock); \
64 char *aio_buf = malloc (AIO_BUFSIZE); \ 66 self->dbuf = aio_buf = malloc (AIO_BUFSIZE); \
67 UNLOCK (wrklock); \
65 if (!aio_buf) \ 68 if (!aio_buf) \
66 return -1; 69 return -1;
67
68#define fBUF free (aio_buf)
69 70
70enum { 71enum {
71 REQ_QUIT, 72 REQ_QUIT,
72 REQ_OPEN, REQ_CLOSE, 73 REQ_OPEN, REQ_CLOSE,
73 REQ_READ, REQ_WRITE, REQ_READAHEAD, 74 REQ_READ, REQ_WRITE, REQ_READAHEAD,
127 128
128static int next_pri = DEFAULT_PRI + PRI_BIAS; 129static int next_pri = DEFAULT_PRI + PRI_BIAS;
129 130
130static int started, wanted; 131static int started, wanted;
131static volatile int nreqs; 132static volatile int nreqs;
132static int max_outstanding = 1<<30;
133static int respipe [2]; 133static int respipe [2];
134 134
135#if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP) 135#if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP)
136# define AIO_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP 136# define AIO_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
137#else 137#else
138# define AIO_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER 138# define AIO_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
139#endif 139#endif
140
141#define LOCK(mutex) pthread_mutex_lock (&(mutex))
142#define UNLOCK(mutex) pthread_mutex_unlock (&(mutex))
143
144/* worker threasd management */
145static pthread_mutex_t wrklock = AIO_MUTEX_INIT;
146
147typedef struct worker {
148 /* locked by wrklock */
149 struct worker *prev, *next;
150
151 pthread_t tid;
152
153 /* locked by reslock, reqlock or wrklock */
154 aio_req req; /* currently processed request */
155 void *dbuf;
156 DIR *dirp;
157} worker;
158
159static worker wrk_first = { &wrk_first, &wrk_first, 0 };
160
161static void worker_clear (worker *wrk)
162{
163 if (wrk->dirp)
164 {
165 closedir (wrk->dirp);
166 wrk->dirp = 0;
167 }
168
169 if (wrk->dbuf)
170 {
171 free (wrk->dbuf);
172 wrk->dbuf = 0;
173 }
174}
175
176static void worker_free (worker *wrk)
177{
178 wrk->next->prev = wrk->prev;
179 wrk->prev->next = wrk->next;
180
181 free (wrk);
182}
140 183
141static pthread_mutex_t reslock = AIO_MUTEX_INIT; 184static pthread_mutex_t reslock = AIO_MUTEX_INIT;
142static pthread_mutex_t reqlock = AIO_MUTEX_INIT; 185static pthread_mutex_t reqlock = AIO_MUTEX_INIT;
143static pthread_cond_t reqwait = PTHREAD_COND_INITIALIZER; 186static pthread_cond_t reqwait = PTHREAD_COND_INITIALIZER;
144 187
194 } 237 }
195 238
196 abort (); 239 abort ();
197} 240}
198 241
242static int poll_cb ();
199static void req_invoke (aio_req req); 243static void req_invoke (aio_req req);
200static void req_free (aio_req req); 244static void req_free (aio_req req);
245static void req_cancel (aio_req req);
201 246
202/* must be called at most once */ 247/* must be called at most once */
203static SV *req_sv (aio_req req, const char *klass) 248static SV *req_sv (aio_req req, const char *klass)
204{ 249{
205 if (!req->self) 250 if (!req->self)
274 fd_set rfd; 319 fd_set rfd;
275 320
276 while (nreqs) 321 while (nreqs)
277 { 322 {
278 int size; 323 int size;
279#if !(__i386 || __x86_64) /* safe without sempahore on this archs */ 324#if !(__i386 || __x86_64) /* safe without sempahore on these archs */
280 pthread_mutex_lock (&reslock); 325 LOCK (reslock);
281#endif 326#endif
282 size = res_queue.size; 327 size = res_queue.size;
283#if !(__i386 || __x86_64) /* safe without sempahore on this archs */ 328#if !(__i386 || __x86_64) /* safe without sempahore on these archs */
284 pthread_mutex_unlock (&reslock); 329 UNLOCK (reslock);
285#endif 330#endif
286 331
287 if (size) 332 if (size)
288 return; 333 return;
289 334
313 { 358 {
314 SV *rv = &PL_sv_undef; 359 SV *rv = &PL_sv_undef;
315 360
316 if (req->result >= 0) 361 if (req->result >= 0)
317 { 362 {
363 int i;
318 char *buf = req->data2ptr; 364 char *buf = req->data2ptr;
319 AV *av = newAV (); 365 AV *av = newAV ();
320 366
321 while (req->result) 367 av_extend (av, req->result - 1);
368
369 for (i = 0; i < req->result; ++i)
322 { 370 {
323 SV *sv = newSVpv (buf, 0); 371 SV *sv = newSVpv (buf, 0);
324 372
325 av_push (av, sv); 373 av_store (av, i, sv);
326 buf += SvCUR (sv) + 1; 374 buf += SvCUR (sv) + 1;
327 req->result--;
328 } 375 }
329 376
330 rv = sv_2mortal (newRV_noinc ((SV *)av)); 377 rv = sv_2mortal (newRV_noinc ((SV *)av));
331 } 378 }
332 379
416 SvREFCNT_dec (req->fh); 463 SvREFCNT_dec (req->fh);
417 SvREFCNT_dec (req->fh2); 464 SvREFCNT_dec (req->fh2);
418 SvREFCNT_dec (req->callback); 465 SvREFCNT_dec (req->callback);
419 Safefree (req->statdata); 466 Safefree (req->statdata);
420 467
421 if (req->type == REQ_READDIR && req->result >= 0) 468 if (req->type == REQ_READDIR)
422 free (req->data2ptr); 469 free (req->data2ptr);
423 470
424 Safefree (req); 471 Safefree (req);
425} 472}
426 473
474static void req_cancel_subs (aio_req grp)
475{
476 aio_req sub;
477
478 if (grp->type != REQ_GROUP)
479 return;
480
481 SvREFCNT_dec (grp->fh2);
482 grp->fh2 = 0;
483
484 for (sub = grp->grp_first; sub; sub = sub->grp_next)
485 req_cancel (sub);
486}
487
427static void req_cancel (aio_req req) 488static void req_cancel (aio_req req)
428{ 489{
429 req->flags |= FLAG_CANCELLED; 490 req->flags |= FLAG_CANCELLED;
430 491
431 if (req->type == REQ_GROUP) 492 req_cancel_subs (req);
432 {
433 aio_req sub;
434
435 for (sub = req->grp_first; sub; sub = sub->grp_next)
436 req_cancel (sub);
437 }
438} 493}
439 494
440static int poll_cb () 495static int poll_cb ()
441{ 496{
442 dSP; 497 dSP;
444 int do_croak = 0; 499 int do_croak = 0;
445 aio_req req; 500 aio_req req;
446 501
447 for (;;) 502 for (;;)
448 { 503 {
449 pthread_mutex_lock (&reslock); 504 LOCK (reslock);
450 req = reqq_shift (&res_queue); 505 req = reqq_shift (&res_queue);
451 506
452 if (req) 507 if (req)
453 { 508 {
454 if (!res_queue.size) 509 if (!res_queue.size)
458 while (read (respipe [0], buf, 32) == 32) 513 while (read (respipe [0], buf, 32) == 32)
459 ; 514 ;
460 } 515 }
461 } 516 }
462 517
463 pthread_mutex_unlock (&reslock); 518 UNLOCK (reslock);
464 519
465 if (!req) 520 if (!req)
466 break; 521 break;
467 522
468 --nreqs; 523 --nreqs;
503static void *aio_proc(void *arg); 558static void *aio_proc(void *arg);
504 559
505static void start_thread (void) 560static void start_thread (void)
506{ 561{
507 sigset_t fullsigset, oldsigset; 562 sigset_t fullsigset, oldsigset;
508 pthread_t tid;
509 pthread_attr_t attr; 563 pthread_attr_t attr;
564
565 worker *wrk = calloc (1, sizeof (worker));
566
567 if (!wrk)
568 croak ("unable to allocate worker thread data");
510 569
511 pthread_attr_init (&attr); 570 pthread_attr_init (&attr);
512 pthread_attr_setstacksize (&attr, STACKSIZE); 571 pthread_attr_setstacksize (&attr, STACKSIZE);
513 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); 572 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
514 573
515 sigfillset (&fullsigset); 574 sigfillset (&fullsigset);
575
576 LOCK (wrklock);
516 sigprocmask (SIG_SETMASK, &fullsigset, &oldsigset); 577 sigprocmask (SIG_SETMASK, &fullsigset, &oldsigset);
517 578
518 if (pthread_create (&tid, &attr, aio_proc, 0) == 0) 579 if (pthread_create (&wrk->tid, &attr, aio_proc, (void *)wrk) == 0)
580 {
581 wrk->prev = &wrk_first;
582 wrk->next = wrk_first.next;
583 wrk_first.next->prev = wrk;
584 wrk_first.next = wrk;
519 started++; 585 started++;
586 }
587 else
588 free (wrk);
520 589
521 sigprocmask (SIG_SETMASK, &oldsigset, 0); 590 sigprocmask (SIG_SETMASK, &oldsigset, 0);
591 UNLOCK (wrklock);
522} 592}
523 593
524static void req_send (aio_req req) 594static void req_send (aio_req req)
525{ 595{
526 while (started < wanted && nreqs >= started) 596 while (started < wanted && nreqs >= started)
527 start_thread (); 597 start_thread ();
528 598
529 ++nreqs; 599 ++nreqs;
530 600
531 pthread_mutex_lock (&reqlock); 601 LOCK (reqlock);
532 reqq_push (&req_queue, req); 602 reqq_push (&req_queue, req);
533 pthread_cond_signal (&reqwait); 603 pthread_cond_signal (&reqwait);
534 pthread_mutex_unlock (&reqlock); 604 UNLOCK (reqlock);
535
536 if (nreqs > max_outstanding)
537 for (;;)
538 {
539 poll_cb ();
540
541 if (nreqs <= max_outstanding)
542 break;
543
544 poll_wait ();
545 }
546} 605}
547 606
548static void end_thread (void) 607static void end_thread (void)
549{ 608{
550 aio_req req; 609 aio_req req;
612static ssize_t pread (int fd, void *buf, size_t count, off_t offset) 671static ssize_t pread (int fd, void *buf, size_t count, off_t offset)
613{ 672{
614 ssize_t res; 673 ssize_t res;
615 off_t ooffset; 674 off_t ooffset;
616 675
617 pthread_mutex_lock (&preadwritelock); 676 LOCK (preadwritelock);
618 ooffset = lseek (fd, 0, SEEK_CUR); 677 ooffset = lseek (fd, 0, SEEK_CUR);
619 lseek (fd, offset, SEEK_SET); 678 lseek (fd, offset, SEEK_SET);
620 res = read (fd, buf, count); 679 res = read (fd, buf, count);
621 lseek (fd, ooffset, SEEK_SET); 680 lseek (fd, ooffset, SEEK_SET);
622 pthread_mutex_unlock (&preadwritelock); 681 UNLOCK (preadwritelock);
623 682
624 return res; 683 return res;
625} 684}
626 685
627static ssize_t pwrite (int fd, void *buf, size_t count, off_t offset) 686static ssize_t pwrite (int fd, void *buf, size_t count, off_t offset)
628{ 687{
629 ssize_t res; 688 ssize_t res;
630 off_t ooffset; 689 off_t ooffset;
631 690
632 pthread_mutex_lock (&preadwritelock); 691 LOCK (preadwritelock);
633 ooffset = lseek (fd, 0, SEEK_CUR); 692 ooffset = lseek (fd, 0, SEEK_CUR);
634 lseek (fd, offset, SEEK_SET); 693 lseek (fd, offset, SEEK_SET);
635 res = write (fd, buf, count); 694 res = write (fd, buf, count);
636 lseek (fd, offset, SEEK_SET); 695 lseek (fd, offset, SEEK_SET);
637 pthread_mutex_unlock (&preadwritelock); 696 UNLOCK (preadwritelock);
638 697
639 return res; 698 return res;
640} 699}
641#endif 700#endif
642 701
658 pread (fd, aio_buf, len, offset); 717 pread (fd, aio_buf, len, offset);
659 offset += len; 718 offset += len;
660 count -= len; 719 count -= len;
661 } 720 }
662 721
663 fBUF;
664
665 errno = 0; 722 errno = 0;
666} 723}
667#endif 724#endif
668 725
669#if !HAVE_READDIR_R 726#if !HAVE_READDIR_R
674static int readdir_r (DIR *dirp, struct dirent *ent, struct dirent **res) 731static int readdir_r (DIR *dirp, struct dirent *ent, struct dirent **res)
675{ 732{
676 struct dirent *e; 733 struct dirent *e;
677 int errorno; 734 int errorno;
678 735
679 pthread_mutex_lock (&readdirlock); 736 LOCK (readdirlock);
680 737
681 e = readdir (dirp); 738 e = readdir (dirp);
682 errorno = errno; 739 errorno = errno;
683 740
684 if (e) 741 if (e)
687 strcpy (ent->d_name, e->d_name); 744 strcpy (ent->d_name, e->d_name);
688 } 745 }
689 else 746 else
690 *res = 0; 747 *res = 0;
691 748
692 pthread_mutex_unlock (&readdirlock); 749 UNLOCK (readdirlock);
693 750
694 errno = errorno; 751 errno = errorno;
695 return e ? 0 : -1; 752 return e ? 0 : -1;
696} 753}
697#endif 754#endif
698 755
699/* sendfile always needs emulation */ 756/* sendfile always needs emulation */
700static ssize_t sendfile_ (int ofd, int ifd, off_t offset, size_t count) 757static ssize_t sendfile_ (int ofd, int ifd, off_t offset, size_t count, worker *self)
701{ 758{
702 ssize_t res; 759 ssize_t res;
703 760
704 if (!count) 761 if (!count)
705 return 0; 762 return 0;
782 839
783 offset += cnt; 840 offset += cnt;
784 res += cnt; 841 res += cnt;
785 count -= cnt; 842 count -= cnt;
786 } 843 }
787
788 fBUF;
789 } 844 }
790 845
791 return res; 846 return res;
792} 847}
793 848
794/* read a full directory */ 849/* read a full directory */
795static int scandir_ (const char *path, void **namesp) 850static void scandir_ (aio_req req, worker *self)
796{ 851{
797 DIR *dirp; 852 DIR *dirp;
798 union 853 union
799 { 854 {
800 struct dirent d; 855 struct dirent d;
805 int memlen = 4096; 860 int memlen = 4096;
806 int memofs = 0; 861 int memofs = 0;
807 int res = 0; 862 int res = 0;
808 int errorno; 863 int errorno;
809 864
810 dirp = opendir (path); 865 LOCK (wrklock);
811 if (!dirp) 866 self->dirp = dirp = opendir (req->dataptr);
812 return -1;
813
814 u = malloc (sizeof (*u)); 867 self->dbuf = u = malloc (sizeof (*u));
868 UNLOCK (wrklock);
869
815 names = malloc (memlen); 870 req->data2ptr = names = malloc (memlen);
816 871
817 if (u && names) 872 if (dirp && u && names)
818 for (;;) 873 for (;;)
819 { 874 {
820 errno = 0; 875 errno = 0;
821 readdir_r (dirp, &u->d, &entp); 876 readdir_r (dirp, &u->d, &entp);
822 877
832 res++; 887 res++;
833 888
834 while (memofs + len > memlen) 889 while (memofs + len > memlen)
835 { 890 {
836 memlen *= 2; 891 memlen *= 2;
892 LOCK (wrklock);
837 names = realloc (names, memlen); 893 req->data2ptr = names = realloc (names, memlen);
894 UNLOCK (wrklock);
895
838 if (!names) 896 if (!names)
839 break; 897 break;
840 } 898 }
841 899
842 memcpy (names + memofs, name, len); 900 memcpy (names + memofs, name, len);
843 memofs += len; 901 memofs += len;
844 } 902 }
845 } 903 }
846 904
847 errorno = errno;
848 free (u);
849 closedir (dirp);
850
851 if (errorno) 905 if (errno)
852 {
853 free (names);
854 errno = errorno;
855 res = -1; 906 res = -1;
856 } 907
857 908 req->result = res;
858 *namesp = (void *)names;
859 return res;
860} 909}
861 910
862/*****************************************************************************/ 911/*****************************************************************************/
863 912
864static void *aio_proc (void *thr_arg) 913static void *aio_proc (void *thr_arg)
865{ 914{
866 aio_req req; 915 aio_req req;
867 int type; 916 int type;
917 worker *self = (worker *)thr_arg;
868 918
869 do 919 do
870 { 920 {
871 pthread_mutex_lock (&reqlock); 921 LOCK (reqlock);
872 922
873 for (;;) 923 for (;;)
874 { 924 {
875 req = reqq_shift (&req_queue); 925 self->req = req = reqq_shift (&req_queue);
876 926
877 if (req) 927 if (req)
878 break; 928 break;
879 929
880 pthread_cond_wait (&reqwait, &reqlock); 930 pthread_cond_wait (&reqwait, &reqlock);
881 } 931 }
882 932
883 pthread_mutex_unlock (&reqlock); 933 UNLOCK (reqlock);
884 934
885 errno = 0; /* strictly unnecessary */ 935 errno = 0; /* strictly unnecessary */
886 type = req->type; /* remember type for QUIT check */ 936 type = req->type; /* remember type for QUIT check */
887 937
888 if (!(req->flags & FLAG_CANCELLED)) 938 if (!(req->flags & FLAG_CANCELLED))
890 { 940 {
891 case REQ_READ: req->result = pread (req->fd, req->dataptr, req->length, req->offset); break; 941 case REQ_READ: req->result = pread (req->fd, req->dataptr, req->length, req->offset); break;
892 case REQ_WRITE: req->result = pwrite (req->fd, req->dataptr, req->length, req->offset); break; 942 case REQ_WRITE: req->result = pwrite (req->fd, req->dataptr, req->length, req->offset); break;
893 943
894 case REQ_READAHEAD: req->result = readahead (req->fd, req->offset, req->length); break; 944 case REQ_READAHEAD: req->result = readahead (req->fd, req->offset, req->length); break;
895 case REQ_SENDFILE: req->result = sendfile_ (req->fd, req->fd2, req->offset, req->length); break; 945 case REQ_SENDFILE: req->result = sendfile_ (req->fd, req->fd2, req->offset, req->length, self); break;
896 946
897 case REQ_STAT: req->result = stat (req->dataptr, req->statdata); break; 947 case REQ_STAT: req->result = stat (req->dataptr, req->statdata); break;
898 case REQ_LSTAT: req->result = lstat (req->dataptr, req->statdata); break; 948 case REQ_LSTAT: req->result = lstat (req->dataptr, req->statdata); break;
899 case REQ_FSTAT: req->result = fstat (req->fd , req->statdata); break; 949 case REQ_FSTAT: req->result = fstat (req->fd , req->statdata); break;
900 950
906 case REQ_LINK: req->result = link (req->data2ptr, req->dataptr); break; 956 case REQ_LINK: req->result = link (req->data2ptr, req->dataptr); break;
907 case REQ_SYMLINK: req->result = symlink (req->data2ptr, req->dataptr); break; 957 case REQ_SYMLINK: req->result = symlink (req->data2ptr, req->dataptr); break;
908 958
909 case REQ_FDATASYNC: req->result = fdatasync (req->fd); break; 959 case REQ_FDATASYNC: req->result = fdatasync (req->fd); break;
910 case REQ_FSYNC: req->result = fsync (req->fd); break; 960 case REQ_FSYNC: req->result = fsync (req->fd); break;
911 case REQ_READDIR: req->result = scandir_ (req->dataptr, &req->data2ptr); break; 961 case REQ_READDIR: scandir_ (req, self); break;
912 962
913 case REQ_BUSY: 963 case REQ_BUSY:
914 { 964 {
915 struct timeval tv; 965 struct timeval tv;
916 966
930 break; 980 break;
931 } 981 }
932 982
933 req->errorno = errno; 983 req->errorno = errno;
934 984
935 pthread_mutex_lock (&reslock); 985 LOCK (reslock);
936 986
937 if (!reqq_push (&res_queue, req)) 987 if (!reqq_push (&res_queue, req))
938 /* write a dummy byte to the pipe so fh becomes ready */ 988 /* write a dummy byte to the pipe so fh becomes ready */
939 write (respipe [1], &respipe, 1); 989 write (respipe [1], &respipe, 1);
940 990
941 pthread_mutex_unlock (&reslock); 991 self->req = 0;
992 worker_clear (self);
993
994 UNLOCK (reslock);
942 } 995 }
943 while (type != REQ_QUIT); 996 while (type != REQ_QUIT);
944 997
998 LOCK (wrklock);
999 worker_free (self);
1000 UNLOCK (wrklock);
1001
945 return 0; 1002 return 0;
946} 1003}
947 1004
948/*****************************************************************************/ 1005/*****************************************************************************/
949 1006
950static void atfork_prepare (void) 1007static void atfork_prepare (void)
951{ 1008{
952 pthread_mutex_lock (&reqlock); 1009 LOCK (wrklock);
953 pthread_mutex_lock (&reslock); 1010 LOCK (reqlock);
1011 LOCK (reslock);
954#if !HAVE_PREADWRITE 1012#if !HAVE_PREADWRITE
955 pthread_mutex_lock (&preadwritelock); 1013 LOCK (preadwritelock);
956#endif 1014#endif
957#if !HAVE_READDIR_R 1015#if !HAVE_READDIR_R
958 pthread_mutex_lock (&readdirlock); 1016 LOCK (readdirlock);
959#endif 1017#endif
960} 1018}
961 1019
962static void atfork_parent (void) 1020static void atfork_parent (void)
963{ 1021{
964#if !HAVE_READDIR_R 1022#if !HAVE_READDIR_R
965 pthread_mutex_unlock (&readdirlock); 1023 UNLOCK (readdirlock);
966#endif 1024#endif
967#if !HAVE_PREADWRITE 1025#if !HAVE_PREADWRITE
968 pthread_mutex_unlock (&preadwritelock); 1026 UNLOCK (preadwritelock);
969#endif 1027#endif
970 pthread_mutex_unlock (&reslock); 1028 UNLOCK (reslock);
971 pthread_mutex_unlock (&reqlock); 1029 UNLOCK (reqlock);
1030 UNLOCK (wrklock);
972} 1031}
973 1032
974static void atfork_child (void) 1033static void atfork_child (void)
975{ 1034{
976 aio_req prv; 1035 aio_req prv;
977
978 started = 0;
979 1036
980 while (prv = reqq_shift (&req_queue)) 1037 while (prv = reqq_shift (&req_queue))
981 req_free (prv); 1038 req_free (prv);
982 1039
983 while (prv = reqq_shift (&res_queue)) 1040 while (prv = reqq_shift (&res_queue))
984 req_free (prv); 1041 req_free (prv);
985 1042
1043 while (wrk_first.next != &wrk_first)
1044 {
1045 worker *wrk = wrk_first.next;
1046
1047 if (wrk->req)
1048 req_free (wrk->req);
1049
1050 worker_clear (wrk);
1051 worker_free (wrk);
1052 }
1053
1054 started = 0;
1055 nreqs = 0;
1056
986 close (respipe [0]); 1057 close (respipe [0]);
987 close (respipe [1]); 1058 close (respipe [1]);
988 create_pipe (); 1059 create_pipe ();
989 1060
990 atfork_parent (); 1061 atfork_parent ();
1034void 1105void
1035max_parallel (nthreads) 1106max_parallel (nthreads)
1036 int nthreads 1107 int nthreads
1037 PROTOTYPE: $ 1108 PROTOTYPE: $
1038 1109
1039int
1040max_outstanding (nreqs)
1041 int nreqs
1042 PROTOTYPE: $
1043 CODE:
1044 RETVAL = max_outstanding;
1045 max_outstanding = nreqs;
1046
1047void 1110void
1048aio_open (pathname,flags,mode,callback=&PL_sv_undef) 1111aio_open (pathname,flags,mode,callback=&PL_sv_undef)
1049 SV * pathname 1112 SV * pathname
1050 int flags 1113 int flags
1051 int mode 1114 int mode
1422 } 1485 }
1423 } 1486 }
1424} 1487}
1425 1488
1426void 1489void
1490cancel_subs (aio_req_ornot req)
1491 CODE:
1492 req_cancel_subs (req);
1493
1494void
1427result (aio_req grp, ...) 1495result (aio_req grp, ...)
1428 CODE: 1496 CODE:
1429{ 1497{
1430 int i; 1498 int i;
1431 AV *av = newAV (); 1499 AV *av = newAV ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines