Commit ca9b30a
thread_sync: redo r62934 to use fork_gen
Instead of maintaining linked-lists to store all
rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen
serial number to simplify management of these items.
This reduces initialization costs and avoids the up-front cost
of resetting all Queue/SizedQueue/ConditionVariable objects at
fork while saving 8 bytes per-structure on 64-bit. There are no
savings on 32-bit.
* thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call
* thread_sync.c (rb_thread_sync_reset_all): remove
* thread_sync.c (queue_live): remove
* thread_sync.c (queue_free): remove
* thread_sync.c (struct rb_queue): s/live/fork_gen/
* thread_sync.c (queue_data_type): use default free
* thread_sync.c (queue_alloc): remove list_add
* thread_sync.c (queue_fork_check): new function
* thread_sync.c (queue_ptr): call queue_fork_check
* thread_sync.c (szqueue_free): remove
* thread_sync.c (szqueue_data_type): use default free
* thread_sync.c (szqueue_alloc): remove list_add
* thread_sync.c (szqueue_ptr): check fork_gen via queue_fork_check
* thread_sync.c (struct rb_condvar): s/live/fork_gen/
* thread_sync.c (condvar_free): remove
* thread_sync.c (cv_data_type): use default free
* thread_sync.c (condvar_ptr): check fork_gen
* thread_sync.c (condvar_alloc): remove list_add
[ruby-core:86316] [Bug ruby#14634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e1 parent 945bf91 commit ca9b30a
2 files changed
+33
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4189 | 4189 | | |
4190 | 4190 | | |
4191 | 4191 | | |
4192 | | - | |
4193 | 4192 | | |
4194 | 4193 | | |
4195 | 4194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
544 | 543 | | |
545 | 544 | | |
546 | 545 | | |
547 | | - | |
548 | 546 | | |
549 | | - | |
550 | 547 | | |
| 548 | + | |
551 | 549 | | |
552 | 550 | | |
553 | 551 | | |
554 | 552 | | |
555 | 553 | | |
556 | 554 | | |
557 | | - | |
558 | 555 | | |
559 | 556 | | |
560 | 557 | | |
| |||
571 | 568 | | |
572 | 569 | | |
573 | 570 | | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | 571 | | |
583 | 572 | | |
584 | 573 | | |
| |||
587 | 576 | | |
588 | 577 | | |
589 | 578 | | |
590 | | - | |
| 579 | + | |
591 | 580 | | |
592 | 581 | | |
593 | 582 | | |
| |||
599 | 588 | | |
600 | 589 | | |
601 | 590 | | |
602 | | - | |
603 | 591 | | |
604 | 592 | | |
605 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
606 | 609 | | |
607 | 610 | | |
608 | 611 | | |
609 | 612 | | |
610 | 613 | | |
611 | 614 | | |
| 615 | + | |
| 616 | + | |
612 | 617 | | |
613 | 618 | | |
614 | 619 | | |
| |||
622 | 627 | | |
623 | 628 | | |
624 | 629 | | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | 630 | | |
634 | 631 | | |
635 | 632 | | |
| |||
638 | 635 | | |
639 | 636 | | |
640 | 637 | | |
641 | | - | |
| 638 | + | |
642 | 639 | | |
643 | 640 | | |
644 | 641 | | |
| |||
650 | 647 | | |
651 | 648 | | |
652 | 649 | | |
653 | | - | |
654 | 650 | | |
655 | 651 | | |
656 | 652 | | |
| |||
660 | 656 | | |
661 | 657 | | |
662 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
| |||
1239 | 1240 | | |
1240 | 1241 | | |
1241 | 1242 | | |
1242 | | - | |
1243 | 1243 | | |
1244 | 1244 | | |
1245 | | - | |
| 1245 | + | |
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | 1276 | | |
1285 | 1277 | | |
1286 | 1278 | | |
| |||
1289 | 1281 | | |
1290 | 1282 | | |
1291 | 1283 | | |
1292 | | - | |
| 1284 | + | |
1293 | 1285 | | |
1294 | 1286 | | |
1295 | 1287 | | |
1296 | 1288 | | |
1297 | 1289 | | |
1298 | 1290 | | |
1299 | 1291 | | |
| 1292 | + | |
1300 | 1293 | | |
1301 | 1294 | | |
1302 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1303 | 1301 | | |
1304 | 1302 | | |
1305 | 1303 | | |
| |||
1311 | 1309 | | |
1312 | 1310 | | |
1313 | 1311 | | |
1314 | | - | |
1315 | 1312 | | |
1316 | 1313 | | |
1317 | 1314 | | |
| |||
1425 | 1422 | | |
1426 | 1423 | | |
1427 | 1424 | | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | 1425 | | |
1454 | 1426 | | |
1455 | 1427 | | |
| |||
0 commit comments