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.64 by root, Mon Oct 23 23:54:41 2006 UTC vs.
Revision 1.70 by root, Tue Oct 24 15:15:56 2006 UTC

1/* solaris */
2#define _POSIX_PTHREAD_SEMANTICS 1
3
1#if __linux 4#if __linux
2# define _GNU_SOURCE 5# define _GNU_SOURCE
3#endif 6#endif
4 7
5#define _REENTRANT 1 8#define _REENTRANT 1
46# define NAME_MAX 4096 49# define NAME_MAX 4096
47#endif 50#endif
48 51
49#if __ia64 52#if __ia64
50# define STACKSIZE 65536 53# define STACKSIZE 65536
54#elif __i386 || __x86_64 /* 16k is unreasonably high :( */
55# define STACKSIZE PTHREAD_STACK_MIN
51#else 56#else
52# define STACKSIZE 8192 57# define STACKSIZE 16384
53#endif 58#endif
59
60/* buffer size for various temporary buffers */
61#define AIO_BUFSIZE 65536
62
63#define dBUF \
64 char *aio_buf = malloc (AIO_BUFSIZE); \
65 if (!aio_buf) \
66 return -1;
67
68#define fBUF free (aio_buf)
54 69
55enum { 70enum {
56 REQ_QUIT, 71 REQ_QUIT,
57 REQ_OPEN, REQ_CLOSE, 72 REQ_OPEN, REQ_CLOSE,
58 REQ_READ, REQ_WRITE, REQ_READAHEAD, 73 REQ_READ, REQ_WRITE, REQ_READAHEAD,
61 REQ_FSYNC, REQ_FDATASYNC, 76 REQ_FSYNC, REQ_FDATASYNC,
62 REQ_UNLINK, REQ_RMDIR, REQ_RENAME, 77 REQ_UNLINK, REQ_RMDIR, REQ_RENAME,
63 REQ_READDIR, 78 REQ_READDIR,
64 REQ_LINK, REQ_SYMLINK, 79 REQ_LINK, REQ_SYMLINK,
65 REQ_GROUP, REQ_NOP, 80 REQ_GROUP, REQ_NOP,
66 REQ_SLEEP, 81 REQ_BUSY,
67}; 82};
68 83
69#define AIO_REQ_KLASS "IO::AIO::REQ" 84#define AIO_REQ_KLASS "IO::AIO::REQ"
70#define AIO_GRP_KLASS "IO::AIO::GRP" 85#define AIO_GRP_KLASS "IO::AIO::GRP"
71 86
105 PRI_MIN = -4, 120 PRI_MIN = -4,
106 PRI_MAX = 4, 121 PRI_MAX = 4,
107 122
108 DEFAULT_PRI = 0, 123 DEFAULT_PRI = 0,
109 PRI_BIAS = -PRI_MIN, 124 PRI_BIAS = -PRI_MIN,
125 NUM_PRI = PRI_MAX + PRI_BIAS + 1,
110}; 126};
111 127
112static int next_pri = DEFAULT_PRI + PRI_BIAS; 128static int next_pri = DEFAULT_PRI + PRI_BIAS;
113 129
114static int started, wanted; 130static int started, wanted;
124 140
125static pthread_mutex_t reslock = AIO_MUTEX_INIT; 141static pthread_mutex_t reslock = AIO_MUTEX_INIT;
126static pthread_mutex_t reqlock = AIO_MUTEX_INIT; 142static pthread_mutex_t reqlock = AIO_MUTEX_INIT;
127static pthread_cond_t reqwait = PTHREAD_COND_INITIALIZER; 143static pthread_cond_t reqwait = PTHREAD_COND_INITIALIZER;
128 144
129static volatile aio_req reqs, reqe; /* queue start, queue end */ 145/*
130static volatile aio_req ress, rese; /* queue start, queue end */ 146 * a somewhat faster data structure might be nice, but
147 * with 8 priorities this actually needs <20 insns
148 * per shift, the most expensive operation.
149 */
150typedef struct {
151 aio_req qs[NUM_PRI], qe[NUM_PRI]; /* qstart, qend */
152 int size;
153} reqq;
154
155static reqq req_queue;
156static reqq res_queue;
157
158int reqq_push (reqq *q, aio_req req)
159{
160 int pri = req->pri;
161 req->next = 0;
162
163 if (q->qe[pri])
164 {
165 q->qe[pri]->next = req;
166 q->qe[pri] = req;
167 }
168 else
169 q->qe[pri] = q->qs[pri] = req;
170
171 return q->size++;
172}
173
174aio_req reqq_shift (reqq *q)
175{
176 int pri;
177
178 if (!q->size)
179 return 0;
180
181 --q->size;
182
183 for (pri = NUM_PRI; pri--; )
184 {
185 aio_req req = q->qs[pri];
186
187 if (req)
188 {
189 if (!(q->qs[pri] = req->next))
190 q->qe[pri] = 0;
191
192 return req;
193 }
194 }
195
196 abort ();
197}
131 198
132static void req_invoke (aio_req req); 199static void req_invoke (aio_req req);
133static void req_free (aio_req req); 200static void req_free (aio_req req);
134 201
135/* must be called at most once */ 202/* must be called at most once */
169 ENTER; 236 ENTER;
170 SAVETMPS; 237 SAVETMPS;
171 PUSHMARK (SP); 238 PUSHMARK (SP);
172 XPUSHs (req_sv (grp, AIO_GRP_KLASS)); 239 XPUSHs (req_sv (grp, AIO_GRP_KLASS));
173 PUTBACK; 240 PUTBACK;
174 call_sv (grp->fh2, G_VOID | G_EVAL); 241 call_sv (grp->fh2, G_VOID | G_EVAL | G_KEEPERR);
175 SPAGAIN; 242 SPAGAIN;
176 FREETMPS; 243 FREETMPS;
177 LEAVE; 244 LEAVE;
178 } 245 }
179 246
206{ 273{
207 fd_set rfd; 274 fd_set rfd;
208 275
209 while (nreqs) 276 while (nreqs)
210 { 277 {
211 aio_req req; 278 int size;
212#if !(__x86 || __x86_64) /* safe without sempahore on this archs */ 279#if !(__i386 || __x86_64) /* safe without sempahore on this archs */
213 pthread_mutex_lock (&reslock); 280 pthread_mutex_lock (&reslock);
214#endif 281#endif
215 req = ress; 282 size = res_queue.size;
216#if !(__x86 || __x86_64) /* safe without sempahore on this archs */ 283#if !(__i386 || __x86_64) /* safe without sempahore on this archs */
217 pthread_mutex_unlock (&reslock); 284 pthread_mutex_unlock (&reslock);
218#endif 285#endif
219 286
220 if (req) 287 if (size)
221 return; 288 return;
222 289
223 FD_ZERO(&rfd); 290 FD_ZERO(&rfd);
224 FD_SET(respipe [0], &rfd); 291 FD_SET(respipe [0], &rfd);
225 292
228} 295}
229 296
230static void req_invoke (aio_req req) 297static void req_invoke (aio_req req)
231{ 298{
232 dSP; 299 dSP;
233 int errorno = errno;
234 300
235 if (req->flags & FLAG_CANCELLED || !SvOK (req->callback)) 301 if (!(req->flags & FLAG_CANCELLED) && SvOK (req->callback))
236 return; 302 {
237
238 errno = req->errorno; 303 errno = req->errorno;
239 304
240 ENTER; 305 ENTER;
241 SAVETMPS; 306 SAVETMPS;
242 PUSHMARK (SP); 307 PUSHMARK (SP);
243 EXTEND (SP, 1); 308 EXTEND (SP, 1);
244 309
245 switch (req->type) 310 switch (req->type)
246 {
247 case REQ_READDIR:
248 { 311 {
249 SV *rv = &PL_sv_undef; 312 case REQ_READDIR:
250
251 if (req->result >= 0)
252 { 313 {
253 char *buf = req->data2ptr; 314 SV *rv = &PL_sv_undef;
254 AV *av = newAV ();
255 315
256 while (req->result) 316 if (req->result >= 0)
257 { 317 {
318 char *buf = req->data2ptr;
319 AV *av = newAV ();
320
321 while (req->result)
322 {
258 SV *sv = newSVpv (buf, 0); 323 SV *sv = newSVpv (buf, 0);
259 324
260 av_push (av, sv); 325 av_push (av, sv);
261 buf += SvCUR (sv) + 1; 326 buf += SvCUR (sv) + 1;
262 req->result--; 327 req->result--;
328 }
329
330 rv = sv_2mortal (newRV_noinc ((SV *)av));
263 } 331 }
264 332
265 rv = sv_2mortal (newRV_noinc ((SV *)av)); 333 PUSHs (rv);
266 } 334 }
335 break;
267 336
268 PUSHs (rv); 337 case REQ_OPEN:
338 {
339 /* convert fd to fh */
340 SV *fh;
341
342 PUSHs (sv_2mortal (newSViv (req->result)));
343 PUTBACK;
344 call_pv ("IO::AIO::_fd2fh", G_SCALAR | G_EVAL);
345 SPAGAIN;
346
347 fh = SvREFCNT_inc (POPs);
348
349 PUSHMARK (SP);
350 XPUSHs (sv_2mortal (fh));
351 }
352 break;
353
354 case REQ_GROUP:
355 req->fd = 2; /* mark group as finished */
356
357 if (req->data)
358 {
359 int i;
360 AV *av = (AV *)req->data;
361
362 EXTEND (SP, AvFILL (av) + 1);
363 for (i = 0; i <= AvFILL (av); ++i)
364 PUSHs (*av_fetch (av, i, 0));
365 }
366 break;
367
368 case REQ_NOP:
369 case REQ_BUSY:
370 break;
371
372 default:
373 PUSHs (sv_2mortal (newSViv (req->result)));
374 break;
269 } 375 }
270 break;
271 376
272 case REQ_OPEN:
273 {
274 /* convert fd to fh */
275 SV *fh;
276 377
277 PUSHs (sv_2mortal (newSViv (req->result)));
278 PUTBACK; 378 PUTBACK;
279 call_pv ("IO::AIO::_fd2fh", G_SCALAR | G_EVAL);
280 SPAGAIN;
281
282 fh = SvREFCNT_inc (POPs);
283
284 PUSHMARK (SP);
285 XPUSHs (sv_2mortal (fh));
286 }
287 break;
288
289 case REQ_GROUP:
290 req->fd = 2; /* mark group as finished */
291
292 if (req->data)
293 {
294 int i;
295 AV *av = (AV *)req->data;
296
297 EXTEND (SP, AvFILL (av) + 1);
298 for (i = 0; i <= AvFILL (av); ++i)
299 PUSHs (*av_fetch (av, i, 0));
300 }
301 break;
302
303 case REQ_NOP:
304 case REQ_SLEEP:
305 break;
306
307 default:
308 PUSHs (sv_2mortal (newSViv (req->result)));
309 break;
310 }
311
312
313 PUTBACK;
314 call_sv (req->callback, G_VOID | G_EVAL); 379 call_sv (req->callback, G_VOID | G_EVAL);
315 SPAGAIN; 380 SPAGAIN;
316 381
317 FREETMPS; 382 FREETMPS;
318 LEAVE; 383 LEAVE;
319
320 errno = errorno;
321
322 if (SvTRUE (ERRSV))
323 { 384 }
324 req_free (req);
325 croak (0);
326 }
327}
328 385
329static void req_free (aio_req req)
330{
331 if (req->grp) 386 if (req->grp)
332 { 387 {
333 aio_req grp = req->grp; 388 aio_req grp = req->grp;
334 389
335 /* unlink request */ 390 /* unlink request */
340 grp->grp_first = req->grp_next; 395 grp->grp_first = req->grp_next;
341 396
342 aio_grp_dec (grp); 397 aio_grp_dec (grp);
343 } 398 }
344 399
400 if (SvTRUE (ERRSV))
401 {
402 req_free (req);
403 croak (0);
404 }
405}
406
407static void req_free (aio_req req)
408{
345 if (req->self) 409 if (req->self)
346 { 410 {
347 sv_unmagic (req->self, PERL_MAGIC_ext); 411 sv_unmagic (req->self, PERL_MAGIC_ext);
348 SvREFCNT_dec (req->self); 412 SvREFCNT_dec (req->self);
349 } 413 }
381 aio_req req; 445 aio_req req;
382 446
383 for (;;) 447 for (;;)
384 { 448 {
385 pthread_mutex_lock (&reslock); 449 pthread_mutex_lock (&reslock);
386 req = ress; 450 req = reqq_shift (&res_queue);
387 451
388 if (req) 452 if (req)
389 { 453 {
390 ress = req->next;
391
392 if (!ress) 454 if (!res_queue.size)
393 { 455 {
394 /* read any signals sent by the worker threads */ 456 /* read any signals sent by the worker threads */
395 char buf [32]; 457 char buf [32];
396 while (read (respipe [0], buf, 32) == 32) 458 while (read (respipe [0], buf, 32) == 32)
397 ; 459 ;
398
399 rese = 0;
400 } 460 }
401 } 461 }
402 462
403 pthread_mutex_unlock (&reslock); 463 pthread_mutex_unlock (&reslock);
404 464
467 start_thread (); 527 start_thread ();
468 528
469 ++nreqs; 529 ++nreqs;
470 530
471 pthread_mutex_lock (&reqlock); 531 pthread_mutex_lock (&reqlock);
472 532 reqq_push (&req_queue, req);
473 req->next = 0;
474
475 if (reqe)
476 {
477 reqe->next = req;
478 reqe = req;
479 }
480 else
481 reqe = reqs = req;
482
483 pthread_cond_signal (&reqwait); 533 pthread_cond_signal (&reqwait);
484 pthread_mutex_unlock (&reqlock); 534 pthread_mutex_unlock (&reqlock);
485 535
486 if (nreqs > max_outstanding) 536 if (nreqs > max_outstanding)
487 for (;;) 537 for (;;)
496} 546}
497 547
498static void end_thread (void) 548static void end_thread (void)
499{ 549{
500 aio_req req; 550 aio_req req;
551
501 Newz (0, req, 1, aio_cb); 552 Newz (0, req, 1, aio_cb);
553
502 req->type = REQ_QUIT; 554 req->type = REQ_QUIT;
555 req->pri = PRI_MAX + PRI_BIAS;
503 556
504 req_send (req); 557 req_send (req);
505} 558}
506 559
507static void min_parallel (int nthreads) 560static void min_parallel (int nthreads)
594#if !HAVE_READAHEAD 647#if !HAVE_READAHEAD
595# define readahead aio_readahead 648# define readahead aio_readahead
596 649
597static ssize_t readahead (int fd, off_t offset, size_t count) 650static ssize_t readahead (int fd, off_t offset, size_t count)
598{ 651{
599 char readahead_buf[4096]; 652 dBUF;
600 653
601 while (count > 0) 654 while (count > 0)
602 { 655 {
603 size_t len = count < sizeof (readahead_buf) ? count : sizeof (readahead_buf); 656 size_t len = count < AIO_BUFSIZE ? count : AIO_BUFSIZE;
604 657
605 pread (fd, readahead_buf, len, offset); 658 pread (fd, aio_buf, len, offset);
606 offset += len; 659 offset += len;
607 count -= len; 660 count -= len;
608 } 661 }
662
663 fBUF;
609 664
610 errno = 0; 665 errno = 0;
611} 666}
612#endif 667#endif
613 668
699#endif 754#endif
700 ) 755 )
701 ) 756 )
702 { 757 {
703 /* emulate sendfile. this is a major pain in the ass */ 758 /* emulate sendfile. this is a major pain in the ass */
704 char buf[4096]; 759 dBUF;
760
705 res = 0; 761 res = 0;
706 762
707 while (count) 763 while (count)
708 { 764 {
709 ssize_t cnt; 765 ssize_t cnt;
710 766
711 cnt = pread (ifd, buf, count > 4096 ? 4096 : count, offset); 767 cnt = pread (ifd, aio_buf, count > AIO_BUFSIZE ? AIO_BUFSIZE : count, offset);
712 768
713 if (cnt <= 0) 769 if (cnt <= 0)
714 { 770 {
715 if (cnt && !res) res = -1; 771 if (cnt && !res) res = -1;
716 break; 772 break;
717 } 773 }
718 774
719 cnt = write (ofd, buf, cnt); 775 cnt = write (ofd, aio_buf, cnt);
720 776
721 if (cnt <= 0) 777 if (cnt <= 0)
722 { 778 {
723 if (cnt && !res) res = -1; 779 if (cnt && !res) res = -1;
724 break; 780 break;
726 782
727 offset += cnt; 783 offset += cnt;
728 res += cnt; 784 res += cnt;
729 count -= cnt; 785 count -= cnt;
730 } 786 }
787
788 fBUF;
731 } 789 }
732 790
733 return res; 791 return res;
734} 792}
735 793
736/* read a full directory */ 794/* read a full directory */
737static int scandir_ (const char *path, void **namesp) 795static int scandir_ (const char *path, void **namesp)
738{ 796{
739 DIR *dirp = opendir (path); 797 DIR *dirp;
740 union 798 union
741 { 799 {
742 struct dirent d; 800 struct dirent d;
743 char b [offsetof (struct dirent, d_name) + NAME_MAX + 1]; 801 char b [offsetof (struct dirent, d_name) + NAME_MAX + 1];
744 } u; 802 } *u;
745 struct dirent *entp; 803 struct dirent *entp;
746 char *name, *names; 804 char *name, *names;
747 int memlen = 4096; 805 int memlen = 4096;
748 int memofs = 0; 806 int memofs = 0;
749 int res = 0; 807 int res = 0;
750 int errorno; 808 int errorno;
751 809
810 dirp = opendir (path);
752 if (!dirp) 811 if (!dirp)
753 return -1; 812 return -1;
754 813
814 u = malloc (sizeof (*u));
755 names = malloc (memlen); 815 names = malloc (memlen);
756 816
817 if (u && names)
757 for (;;) 818 for (;;)
758 { 819 {
820 errno = 0;
759 errno = 0, readdir_r (dirp, &u.d, &entp); 821 readdir_r (dirp, &u->d, &entp);
760 822
761 if (!entp) 823 if (!entp)
762 break; 824 break;
763 825
764 name = entp->d_name; 826 name = entp->d_name;
765 827
766 if (name [0] != '.' || (name [1] && (name [1] != '.' || name [2]))) 828 if (name [0] != '.' || (name [1] && (name [1] != '.' || name [2])))
767 { 829 {
768 int len = strlen (name) + 1; 830 int len = strlen (name) + 1;
769 831
770 res++; 832 res++;
771 833
772 while (memofs + len > memlen) 834 while (memofs + len > memlen)
773 { 835 {
774 memlen *= 2; 836 memlen *= 2;
775 names = realloc (names, memlen); 837 names = realloc (names, memlen);
776 if (!names) 838 if (!names)
777 break; 839 break;
778 } 840 }
779 841
780 memcpy (names + memofs, name, len); 842 memcpy (names + memofs, name, len);
781 memofs += len; 843 memofs += len;
782 } 844 }
783 } 845 }
784 846
785 errorno = errno; 847 errorno = errno;
848 free (u);
786 closedir (dirp); 849 closedir (dirp);
787 850
788 if (errorno) 851 if (errorno)
789 { 852 {
790 free (names); 853 free (names);
807 { 870 {
808 pthread_mutex_lock (&reqlock); 871 pthread_mutex_lock (&reqlock);
809 872
810 for (;;) 873 for (;;)
811 { 874 {
812 req = reqs; 875 req = reqq_shift (&req_queue);
813
814 if (reqs)
815 {
816 reqs = reqs->next;
817 if (!reqs) reqe = 0;
818 }
819 876
820 if (req) 877 if (req)
821 break; 878 break;
822 879
823 pthread_cond_wait (&reqwait, &reqlock); 880 pthread_cond_wait (&reqwait, &reqlock);
851 908
852 case REQ_FDATASYNC: req->result = fdatasync (req->fd); break; 909 case REQ_FDATASYNC: req->result = fdatasync (req->fd); break;
853 case REQ_FSYNC: req->result = fsync (req->fd); break; 910 case REQ_FSYNC: req->result = fsync (req->fd); break;
854 case REQ_READDIR: req->result = scandir_ (req->dataptr, &req->data2ptr); break; 911 case REQ_READDIR: req->result = scandir_ (req->dataptr, &req->data2ptr); break;
855 912
856 case REQ_SLEEP: 913 case REQ_BUSY:
857 { 914 {
858 struct timeval tv; 915 struct timeval tv;
859 916
860 tv.tv_sec = req->fd; 917 tv.tv_sec = req->fd;
861 tv.tv_usec = req->fd2; 918 tv.tv_usec = req->fd2;
875 932
876 req->errorno = errno; 933 req->errorno = errno;
877 934
878 pthread_mutex_lock (&reslock); 935 pthread_mutex_lock (&reslock);
879 936
880 req->next = 0; 937 if (!reqq_push (&res_queue, req))
881
882 if (rese)
883 {
884 rese->next = req;
885 rese = req;
886 }
887 else
888 {
889 rese = ress = req;
890
891 /* write a dummy byte to the pipe so fh becomes ready */ 938 /* write a dummy byte to the pipe so fh becomes ready */
892 write (respipe [1], &respipe, 1); 939 write (respipe [1], &respipe, 1);
893 }
894 940
895 pthread_mutex_unlock (&reslock); 941 pthread_mutex_unlock (&reslock);
896 } 942 }
897 while (type != REQ_QUIT); 943 while (type != REQ_QUIT);
898 944
929{ 975{
930 aio_req prv; 976 aio_req prv;
931 977
932 started = 0; 978 started = 0;
933 979
934 while (reqs) 980 while (prv = reqq_shift (&req_queue))
935 {
936 prv = reqs;
937 reqs = prv->next;
938 req_free (prv); 981 req_free (prv);
939 }
940 982
941 reqs = reqe = 0; 983 while (prv = reqq_shift (&res_queue))
942
943 while (ress)
944 {
945 prv = ress;
946 ress = prv->next;
947 req_free (prv); 984 req_free (prv);
948 } 985
949
950 ress = rese = 0;
951
952 close (respipe [0]); 986 close (respipe [0]);
953 close (respipe [1]); 987 close (respipe [1]);
954 create_pipe (); 988 create_pipe ();
955 989
956 atfork_parent (); 990 atfork_parent ();
1231 1265
1232 REQ_SEND; 1266 REQ_SEND;
1233} 1267}
1234 1268
1235void 1269void
1236aio_sleep (delay,callback=&PL_sv_undef) 1270aio_busy (delay,callback=&PL_sv_undef)
1237 double delay 1271 double delay
1238 SV * callback 1272 SV * callback
1239 PPCODE: 1273 PPCODE:
1240{ 1274{
1241 dREQ; 1275 dREQ;
1242 1276
1243 req->type = REQ_SLEEP; 1277 req->type = REQ_BUSY;
1244 req->fd = delay < 0. ? 0 : delay; 1278 req->fd = delay < 0. ? 0 : delay;
1245 req->fd2 = delay < 0. ? 0 : 1000. * (delay - req->fd); 1279 req->fd2 = delay < 0. ? 0 : 1000. * (delay - req->fd);
1246 1280
1247 REQ_SEND; 1281 REQ_SEND;
1248} 1282}
1271 req->type = REQ_NOP; 1305 req->type = REQ_NOP;
1272 1306
1273 REQ_SEND; 1307 REQ_SEND;
1274} 1308}
1275 1309
1276#if 0
1277
1278void 1310void
1279aio_pri (int pri = DEFAULT_PRI) 1311aioreq_pri (int pri = DEFAULT_PRI)
1280 CODE: 1312 CODE:
1281 if (pri < PRI_MIN) pri = PRI_MIN; 1313 if (pri < PRI_MIN) pri = PRI_MIN;
1282 if (pri > PRI_MAX) pri = PRI_MAX; 1314 if (pri > PRI_MAX) pri = PRI_MAX;
1283 next_pri = pri + PRI_BIAS; 1315 next_pri = pri + PRI_BIAS;
1284 1316
1285#endif 1317void
1318aioreq_nice (int nice = 0)
1319 CODE:
1320 nice = next_pri - nice;
1321 if (nice < PRI_MIN) nice = PRI_MIN;
1322 if (nice > PRI_MAX) nice = PRI_MAX;
1323 next_pri = nice + PRI_BIAS;
1286 1324
1287void 1325void
1288flush () 1326flush ()
1289 PROTOTYPE: 1327 PROTOTYPE:
1290 CODE: 1328 CODE:
1339 1377
1340MODULE = IO::AIO PACKAGE = IO::AIO::REQ 1378MODULE = IO::AIO PACKAGE = IO::AIO::REQ
1341 1379
1342void 1380void
1343cancel (aio_req_ornot req) 1381cancel (aio_req_ornot req)
1344 PROTOTYPE:
1345 CODE: 1382 CODE:
1346 req_cancel (req); 1383 req_cancel (req);
1347 1384
1348void 1385void
1349cb (aio_req_ornot req, SV *callback=&PL_sv_undef) 1386cb (aio_req_ornot req, SV *callback=&PL_sv_undef)
1399 SvREFCNT_dec (grp->data); 1436 SvREFCNT_dec (grp->data);
1400 grp->data = (SV *)av; 1437 grp->data = (SV *)av;
1401} 1438}
1402 1439
1403void 1440void
1404feed_limit (aio_req grp, int limit) 1441limit (aio_req grp, int limit)
1405 CODE: 1442 CODE:
1406 grp->fd2 = limit; 1443 grp->fd2 = limit;
1407 aio_grp_feed (grp); 1444 aio_grp_feed (grp);
1408 1445
1409void 1446void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines