Knowledge (XXG)

epoll

Source đź“ť

1904: 1916: 1890: 420: 1466: 755: 353:
will return, signaling the presence of data to be read. Suppose, the reader only consumed part of data from the buffer. In level-triggered mode, further calls to
1555: 1550: 680: 537: 1908: 35:. Its function is to monitor multiple file descriptors to see whether I/O is possible on any of them. It is meant to replace the older 1287: 1055: 785: 1947: 1397: 725: 1831: 599: 1712: 760: 433: 377: 1942: 1114: 1813: 1627: 745: 673: 1818: 1460: 796: 357:
will return immediately, as long as the pipe's buffer contains data to be read. In edge-triggered mode, however,
1381: 1366: 1282: 1070: 875: 1724: 1523: 1159: 1047: 1002: 952: 936: 913: 735: 1869: 1846: 1841: 1676: 1642: 1632: 1504: 1449: 1326: 865: 624: 1952: 1920: 1823: 666: 489: 1853: 1455: 1017: 715: 1649: 1128: 987: 921: 553: 105:(RB-tree) data structure to keep track of all file descriptors that are currently being monitored. 102: 1803: 1637: 1223: 1123: 1060: 982: 977: 765: 595: 381: 213:
Controls (configures) which file descriptors are watched by this object, and for which events.
1774: 1422: 1392: 1387: 1238: 893: 855: 533: 1528: 1090: 811: 801: 710: 653: 97:
argument denoting the configurable kernel object, against which they cooperatively operate.
51:, to achieve better performance in more demanding applications, where the number of watched 31:
for a scalable I/O event notification mechanism, first introduced in version 2.5.45 of the
1764: 1432: 1213: 574: 94: 52: 604: 1794: 1699: 1610: 1487: 1482: 1477: 1472: 1255: 1080: 1075: 720: 369: 342: 56: 1936: 1729: 1545: 1351: 1341: 1100: 972: 850: 39: 648: 467: 404:
was added in version 2.6.2 of the Linux kernel mainline, released in February 2004.
1894: 1615: 1533: 1427: 1371: 730: 689: 510: 425: 279:, until at least one occurs or the timeout elapses. Returns the occurred events in 32: 25: 376:
had mistakes that could have been avoided, had it learned from its predecessors:
1620: 1513: 1095: 992: 48: 28: 1707: 1682: 1669: 1574: 1562: 1492: 1402: 888: 791: 750: 415: 90: 143:
parameter allows epoll behavior to be modified. It has only one valid value,
1569: 1538: 1407: 1243: 1032: 903: 860: 323: 319: 155:
and is deprecated as of Linux kernel version 2.6.27 and glibc version 2.9.
16:
Linux-specific system call for a scalable I/O event notification mechanism
1687: 1508: 1497: 1417: 1361: 1356: 1302: 1250: 1139: 1065: 444: 1769: 1754: 1664: 1654: 1594: 1518: 1412: 1336: 1277: 1191: 1154: 1085: 1027: 1022: 926: 883: 609: 80: 1759: 1744: 1734: 1589: 1584: 1346: 1297: 1270: 1233: 1203: 1170: 1149: 898: 845: 740: 439: 385: 84: 1889: 1579: 1442: 1376: 1331: 1292: 1260: 1228: 1186: 1181: 1144: 1007: 967: 962: 419: 36: 1659: 1437: 1265: 1196: 840: 662: 658: 1739: 1717: 462: 460: 388:. However, a large part of his criticism was addressed by 55:
is large (unlike the older system calls, which operate in
361:
will return only once new data is written to the pipe.
330:
will return only when a new event is enqueued with the
490:"Using epoll() For Asynchronous Network Programming" 1862: 1802: 1793: 1698: 1603: 1319: 1212: 1122: 1113: 1046: 951: 944: 935: 912: 874: 833: 826: 774: 703: 696: 408:was added in version 4.5, released in March 2016. 295:/file descriptors to be monitored. In most case, 275:Waits for any of the events registered for with 532:(Second ed.). O’Reilly. pp. 97, 98. 674: 8: 338:will return as long as the condition holds. 139:object and returns its file descriptor. The 1799: 1695: 1119: 948: 941: 830: 700: 681: 667: 659: 605:"Ubuntu Slaughters Kittens | BSD Now 103" 326:modes. In edge-triggered mode, a call to 1909:Free and open-source software portal 1467:Earliest eligible virtual deadline first 456: 334:object, while in level-triggered mode, 7: 625:"Epoll is fundamentally broken 1/2" 575:"epoll_wait(2) — Linux manual page" 299:is set to the value of the size of 89:, in that it consists of a set of 14: 511:"The Implementation of epoll (1)" 1915: 1914: 1902: 1888: 756:Supported computer architectures 418: 786:The Linux Programming Interface 627:. idea.popcount.org. 2017-02-20 488:Oleksiy Kovyrin (2006-04-13). 468:"epoll(7) - Linux manual page" 217:can be ADD, MODIFY or DELETE. 1: 378:input/output completion ports 349:has received data, a call to 434:Input/output completion port 1969: 1628:High-performance computing 1450:Process and I/O schedulers 305:struct epoll_event *events 1882: 1461:Completely Fair Scheduler 726:Tanenbaum–Torvalds debate 291:is the maximum number of 93:functions, each taking a 1382:Kernel same-page merging 530:Linux System Programming 219: 157: 112: 1725:OS-level virtualization 554:"epoll_wait: maxevents" 151:is an older variant of 1870:List of Linux adopters 812:Linux User Group (LUG) 470:. Man7.org. 2012-04-17 1948:Linux kernel features 528:Love, Robert (2013). 1456:Brain Fuck Scheduler 716:Linux Mark Institute 1650:Real-time computing 922:Linux Standard Base 341:For instance, if a 1943:Events (computing) 1638:Compute Node Linux 1224:C standard library 1930: 1929: 1878: 1877: 1789: 1788: 1785: 1784: 1423:Network scheduler 1315: 1314: 1311: 1310: 1109: 1108: 856:Linux kernel oops 822: 821: 802:Linux conferences 539:978-1-449-33953-1 517:. September 2014. 372:pointed out that 1960: 1918: 1917: 1907: 1906: 1905: 1895:Linux portal 1893: 1892: 1800: 1696: 1505:Security Modules 1120: 949: 942: 831: 711:Linux Foundation 701: 683: 676: 669: 660: 636: 635: 633: 632: 621: 615: 614: 592: 586: 585: 583: 582: 571: 565: 564: 562: 561: 550: 544: 543: 525: 519: 518: 507: 501: 500: 498: 497: 485: 479: 478: 476: 475: 464: 428: 423: 422: 407: 403: 399: 395: 391: 375: 360: 356: 352: 348: 345:registered with 337: 333: 329: 317: 311:Triggering modes 306: 302: 298: 294: 290: 286: 282: 278: 271: 268: 265: 262: 259: 256: 253: 250: 247: 244: 241: 238: 235: 232: 229: 226: 223: 216: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 164: 161: 154: 150: 146: 142: 138: 131: 128: 125: 122: 119: 116: 100: 87: 78: 68: 53:file descriptors 47: 42: 22: 1968: 1967: 1963: 1962: 1961: 1959: 1958: 1957: 1933: 1932: 1931: 1926: 1903: 1901: 1887: 1874: 1858: 1805: 1781: 1765:User-mode Linux 1694: 1599: 1307: 1215: 1208: 1127: 1105: 1042: 954: 931: 908: 870: 818: 770: 761:Version history 692: 687: 645: 640: 639: 630: 628: 623: 622: 618: 603: 600:Wayback Machine 593: 589: 580: 578: 573: 572: 568: 559: 557: 552: 551: 547: 540: 527: 526: 522: 509: 508: 504: 495: 493: 487: 486: 482: 473: 471: 466: 465: 458: 453: 424: 417: 414: 405: 401: 397: 393: 389: 373: 367: 358: 354: 350: 346: 335: 331: 327: 324:level-triggered 315: 313: 304: 300: 296: 292: 288: 284: 280: 276: 273: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 214: 211: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 165: 162: 159: 153:epoll_create1() 152: 148: 144: 140: 136: 133: 132: 129: 126: 123: 120: 117: 114: 111: 98: 95:file descriptor 85: 76: 66: 45: 40: 20: 17: 12: 11: 5: 1966: 1964: 1956: 1955: 1950: 1945: 1935: 1934: 1928: 1927: 1925: 1924: 1912: 1898: 1883: 1880: 1879: 1876: 1875: 1873: 1872: 1866: 1864: 1860: 1859: 1857: 1856: 1851: 1850: 1849: 1844: 1836: 1835: 1834: 1826: 1821: 1816: 1810: 1808: 1797: 1791: 1790: 1787: 1786: 1783: 1782: 1780: 1779: 1778: 1777: 1772: 1767: 1762: 1757: 1749: 1748: 1747: 1742: 1737: 1732: 1722: 1721: 1720: 1715: 1704: 1702: 1700:Virtualization 1693: 1692: 1691: 1690: 1685: 1674: 1673: 1672: 1667: 1662: 1657: 1647: 1646: 1645: 1640: 1635: 1625: 1624: 1623: 1618: 1607: 1605: 1601: 1600: 1598: 1597: 1592: 1587: 1582: 1577: 1572: 1566: 1565: 1560: 1559: 1558: 1553: 1546:Device drivers 1542: 1541: 1536: 1531: 1526: 1521: 1516: 1511: 1501: 1500: 1495: 1490: 1488:SCHED_DEADLINE 1485: 1483:O(1) scheduler 1480: 1478:O(n) scheduler 1475: 1473:Noop scheduler 1470: 1464: 1458: 1453: 1446: 1445: 1440: 1435: 1430: 1425: 1420: 1415: 1410: 1405: 1400: 1395: 1390: 1385: 1379: 1374: 1369: 1364: 1359: 1354: 1349: 1344: 1339: 1334: 1329: 1327:Kernel modules 1323: 1321: 1317: 1316: 1313: 1312: 1309: 1308: 1306: 1305: 1300: 1295: 1290: 1285: 1280: 1275: 1274: 1273: 1268: 1263: 1258: 1253: 1248: 1247: 1246: 1236: 1231: 1220: 1218: 1210: 1209: 1207: 1206: 1201: 1200: 1199: 1189: 1184: 1179: 1176: 1173: 1168: 1165: 1162: 1157: 1152: 1147: 1142: 1137: 1133: 1131: 1117: 1111: 1110: 1107: 1106: 1104: 1103: 1098: 1093: 1088: 1083: 1081:Memory barrier 1078: 1073: 1068: 1063: 1058: 1052: 1050: 1044: 1043: 1041: 1040: 1039: 1038: 1035: 1030: 1025: 1020: 1015: 1010: 1000: 999: 998: 995: 990: 985: 980: 975: 970: 959: 957: 946: 939: 933: 932: 930: 929: 924: 918: 916: 910: 909: 907: 906: 901: 896: 891: 886: 880: 878: 872: 871: 869: 868: 863: 858: 853: 848: 843: 837: 835: 828: 824: 823: 820: 819: 817: 816: 815: 814: 806: 805: 804: 799: 794: 789: 778: 776: 772: 771: 769: 768: 763: 758: 753: 748: 743: 738: 733: 728: 723: 718: 713: 707: 705: 698: 694: 693: 688: 686: 685: 678: 671: 663: 657: 656: 651: 644: 643:External links 641: 638: 637: 616: 587: 566: 545: 538: 520: 502: 480: 455: 454: 452: 449: 448: 447: 442: 437: 430: 429: 413: 410: 406:EPOLLEXCLUSIVE 398:EPOLLEXCLUSIVE 384:(Solaris) and 370:Bryan Cantrill 366: 363: 320:edge-triggered 318:provides both 312: 309: 220: 158: 149:epoll_create() 113: 110: 107: 103:red–black tree 79:is similar to 15: 13: 10: 9: 6: 4: 3: 2: 1965: 1954: 1951: 1949: 1946: 1944: 1941: 1940: 1938: 1923: 1922: 1913: 1911: 1910: 1899: 1897: 1896: 1891: 1885: 1884: 1881: 1871: 1868: 1867: 1865: 1861: 1855: 1852: 1848: 1845: 1843: 1840: 1839: 1837: 1833: 1830: 1829: 1828:Thin client: 1827: 1825: 1822: 1820: 1817: 1815: 1812: 1811: 1809: 1807: 1801: 1798: 1796: 1792: 1776: 1773: 1771: 1768: 1766: 1763: 1761: 1758: 1756: 1753: 1752: 1750: 1746: 1743: 1741: 1738: 1736: 1733: 1731: 1730:Linux-VServer 1728: 1727: 1726: 1723: 1719: 1716: 1714: 1711: 1710: 1709: 1706: 1705: 1703: 1701: 1697: 1689: 1686: 1684: 1681: 1680: 1678: 1675: 1671: 1668: 1666: 1663: 1661: 1658: 1656: 1653: 1652: 1651: 1648: 1644: 1641: 1639: 1636: 1634: 1631: 1630: 1629: 1626: 1622: 1619: 1617: 1614: 1613: 1612: 1609: 1608: 1606: 1602: 1596: 1593: 1591: 1588: 1586: 1583: 1581: 1578: 1576: 1573: 1571: 1568: 1567: 1564: 1561: 1557: 1554: 1552: 1549: 1548: 1547: 1544: 1543: 1540: 1537: 1535: 1532: 1530: 1527: 1525: 1522: 1520: 1517: 1515: 1512: 1510: 1506: 1503: 1502: 1499: 1496: 1494: 1491: 1489: 1486: 1484: 1481: 1479: 1476: 1474: 1471: 1468: 1465: 1462: 1459: 1457: 1454: 1451: 1448: 1447: 1444: 1441: 1439: 1436: 1434: 1431: 1429: 1426: 1424: 1421: 1419: 1416: 1414: 1411: 1409: 1406: 1404: 1401: 1399: 1396: 1394: 1391: 1389: 1386: 1383: 1380: 1378: 1375: 1373: 1370: 1368: 1365: 1363: 1360: 1358: 1355: 1353: 1352:Device mapper 1350: 1348: 1345: 1343: 1340: 1338: 1335: 1333: 1330: 1328: 1325: 1324: 1322: 1318: 1304: 1301: 1299: 1296: 1294: 1291: 1289: 1286: 1284: 1281: 1279: 1276: 1272: 1269: 1267: 1264: 1262: 1259: 1257: 1254: 1252: 1249: 1245: 1242: 1241: 1240: 1237: 1235: 1232: 1230: 1227: 1226: 1225: 1222: 1221: 1219: 1217: 1211: 1205: 1202: 1198: 1195: 1194: 1193: 1190: 1188: 1185: 1183: 1180: 1177: 1174: 1172: 1169: 1166: 1163: 1161: 1158: 1156: 1153: 1151: 1148: 1146: 1143: 1141: 1138: 1135: 1134: 1132: 1130: 1125: 1121: 1118: 1116: 1112: 1102: 1099: 1097: 1094: 1092: 1089: 1087: 1084: 1082: 1079: 1077: 1074: 1072: 1069: 1067: 1064: 1062: 1059: 1057: 1054: 1053: 1051: 1049: 1045: 1036: 1034: 1031: 1029: 1026: 1024: 1021: 1019: 1016: 1014: 1011: 1009: 1006: 1005: 1004: 1001: 996: 994: 991: 989: 986: 984: 981: 979: 976: 974: 971: 969: 966: 965: 964: 961: 960: 958: 956: 950: 947: 943: 940: 938: 934: 928: 925: 923: 920: 919: 917: 915: 911: 905: 902: 900: 897: 895: 892: 890: 887: 885: 882: 881: 879: 877: 873: 867: 864: 862: 859: 857: 854: 852: 849: 847: 844: 842: 839: 838: 836: 832: 829: 825: 813: 810: 809: 807: 803: 800: 798: 795: 793: 790: 788: 787: 783: 782: 780: 779: 777: 773: 767: 764: 762: 759: 757: 754: 752: 749: 747: 744: 742: 739: 737: 734: 732: 729: 727: 724: 722: 719: 717: 714: 712: 709: 708: 706: 702: 699: 695: 691: 684: 679: 677: 672: 670: 665: 664: 661: 655: 652: 650: 649:epoll manpage 647: 646: 642: 626: 620: 617: 612: 611: 606: 601: 597: 591: 588: 576: 570: 567: 556:. Jun 3, 2010 555: 549: 546: 541: 535: 531: 524: 521: 516: 512: 506: 503: 492:. Kovyrin.net 491: 484: 481: 469: 463: 461: 457: 450: 446: 443: 441: 438: 435: 432: 431: 427: 421: 416: 411: 409: 387: 383: 379: 371: 364: 362: 344: 339: 325: 321: 310: 308: 218: 156: 145:EPOLL_CLOEXEC 118:epoll_create1 108: 106: 104: 96: 92: 88: 82: 74: 72: 64: 60: 59: 54: 50: 43: 38: 34: 30: 27: 23: 1953:System calls 1919: 1900: 1886: 1616:Linux kernel 1534:Tomoyo Linux 1129:File systems 1012: 784: 736:SCO disputes 697:Organization 690:Linux kernel 629:. Retrieved 619: 608: 596:Ghostarchive 594:Archived at 590: 579:. Retrieved 577:. 2023-03-30 569: 558:. Retrieved 548: 529: 523: 514: 505: 494:. Retrieved 483: 472:. Retrieved 426:Linux portal 402:EPOLLONESHOT 394:EPOLLONESHOT 368: 340: 314: 274: 212: 134: 75: 70: 69:operates in 62: 57: 49:system calls 33:Linux kernel 26:Linux kernel 19: 18: 1621:Linux-libre 1514:Exec Shield 1393:Framebuffer 1096:Video4Linux 953:System Call 781:Developers 721:Linus's law 654:epoll patch 382:event ports 293:epoll_event 243:epoll_event 199:epoll_event 135:Creates an 73:(1) time). 29:system call 1937:Categories 1708:Hypervisor 1670:PREEMPT_RT 1575:KernelCare 1563:Raw device 1493:SCHED_FIFO 1403:KMS driver 1320:Components 1175:securityfs 1061:Crypto API 1003:Linux-only 889:System.map 792:kernel.org 751:menuconfig 746:GNU GPL v2 631:2017-10-06 581:2023-07-06 560:2023-07-06 496:2014-03-01 474:2014-03-01 451:References 359:epoll_wait 355:epoll_wait 351:epoll_wait 336:epoll_wait 328:epoll_wait 303:argument ( 225:epoll_wait 91:user-space 1847:LYME-LYCE 1570:initramfs 1539:Linux PAM 1408:Netfilter 1278:libcgroup 1244:libhybris 1216:libraries 1164:hugetlbfs 1115:Userspace 1048:In-kernel 1033:readahead 955:Interface 904:initramfs 861:SystemTap 834:Debugging 827:Technical 766:Criticism 515:idndx.com 400:options. 297:maxevents 289:maxevents 287:at once. 285:maxevents 277:epoll_ctl 258:maxevents 163:epoll_ctl 41:select(2) 1921:Category 1863:Adopters 1838:Server: 1819:Embedded 1795:Adoption 1688:PSXLinux 1611:Mainline 1604:Variants 1556:graphics 1509:AppArmor 1498:SCHED_RR 1418:nftables 1362:dm-crypt 1357:dm-cache 1303:liburing 1293:libevdev 1251:dietlibc 1140:configfs 1066:io uring 598:and the 445:libevent 412:See also 307:array). 283:, up to 65:) time, 1854:Devices 1814:Desktop 1775:coLinux 1770:MkLinux 1755:L4Linux 1683:ÎĽClinux 1665:Xenomai 1655:RTLinux 1595:Ksplice 1524:SELinux 1519:seccomp 1469:(EEVDF) 1413:Netlink 1342:Console 1337:cgroups 1288:libalsa 1214:Wrapper 1192:systemd 1155:debugfs 1124:Daemons 1086:New API 1028:inotify 1023:dnotify 927:x32 ABI 884:vmlinux 876:Startup 775:Support 610:YouTube 301:*events 267:timeout 101:uses a 81:FreeBSD 46:poll(2) 1824:Gaming 1806:of use 1760:ELinOS 1751:Other 1745:OpenVZ 1735:Lguest 1679:-less 1590:kpatch 1585:kGraft 1551:802.11 1347:bcache 1298:libusb 1283:libdrm 1271:Newlib 1256:EGLIBC 1239:Bionic 1234:uClibc 1204:Kmscon 1178:sockfs 1171:procfs 1167:pipefs 1150:devpts 1076:kernfs 1018:splice 973:select 945:Kernel 899:initrd 894:dracut 846:ftrace 808:Users 741:Linaro 704:Kernel 536:  440:kqueue 436:(IOCP) 386:kqueue 281:events 249:events 240:struct 196:struct 86:kqueue 1804:Range 1643:SLURM 1580:kexec 1529:Smack 1463:(CFS) 1443:zswap 1384:(KSM) 1377:evdev 1332:BlueZ 1261:klibc 1229:glibc 1187:tmpfs 1182:sysfs 1145:devfs 1136:bpffs 1013:epoll 1008:futex 988:close 968:ioctl 963:POSIX 851:kdump 390:epoll 374:epoll 347:epoll 332:epoll 316:epoll 205:event 141:flags 137:epoll 127:flags 99:epoll 77:epoll 67:epoll 37:POSIX 24:is a 21:epoll 1842:LAMP 1832:LTSP 1660:RTAI 1438:zram 1433:SLUB 1428:perf 1372:EDAC 1266:musl 1197:udev 1160:FUSE 1056:ALSA 993:sync 983:read 978:open 937:APIs 914:ABIs 841:CRIU 797:LKML 534:ISBN 396:and 365:Bugs 343:pipe 322:and 234:epfd 172:epfd 44:and 1740:LXC 1718:Xen 1713:KVM 1677:MMU 1633:INK 1398:LVM 1388:LIO 1367:DRM 1101:IIO 1091:RCU 1071:DRM 866:BPF 731:Tux 392:'s 264:int 255:int 231:int 222:int 187:int 178:int 169:int 160:int 124:int 115:int 109:API 83:'s 1939:: 1507:: 607:. 602:: 513:. 459:^ 380:, 270:); 215:op 208:); 190:fd 181:op 147:. 130:); 1452:: 1126:, 1037:… 997:… 682:e 675:t 668:v 634:. 613:. 584:. 563:. 542:. 499:. 477:. 261:, 252:, 246:* 237:, 228:( 202:* 193:, 184:, 175:, 166:( 121:( 71:O 63:n 61:( 58:O

Index

Linux kernel
system call
Linux kernel
POSIX
select(2)
system calls
file descriptors
O
FreeBSD
kqueue
user-space
file descriptor
red–black tree
edge-triggered
level-triggered
pipe
Bryan Cantrill
input/output completion ports
event ports
kqueue
icon
Linux portal
Input/output completion port
kqueue
libevent


"epoll(7) - Linux manual page"
"Using epoll() For Asynchronous Network Programming"
"The Implementation of epoll (1)"

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑