I've created a pull request that replaces use of 'select' with 'epoll' for Self running on Linux:
https://github.com/russellallen/self/pull/32
Epoll has better performance than select when there is a large number of open files and does not have the 1,024 file descriptor limit.
ardeujho ardeujho@cd.pn writes:
Epoll has better performance than select when there is a large number of open files and does not have the 1,024 file descriptor limit.
I've made a change to the pull request to account for the fact that epoll doesn't work on regular files. Attempting to do an epoll_ctl on these results in an EPERM error.
I've worked around this by keeping a set of file descriptors that produce this error and automatically adding these to the result of a select call from Self as being readable and writable.
Longer term it might be worthwhile investigating how to get asynchronous i/o working with regular files on Linux to improve performance in i/o bound apps.
In the meantime the workaround means that there is a limit of 1024 open regular files but no limit to the number of sockets and other similar file types.
This is all very cool.
Are there any Self-side changes needed or just the VM?
Russell
On 2014-02-21 12:17, ardeujho wrote:
ardeujho ardeujho@cd.pn writes:
Epoll has better performance than select when there is a large number of open files and does not have the 1,024 file descriptor limit.
I've made a change to the pull request to account for the fact that epoll doesn't work on regular files. Attempting to do an epoll_ctl on these results in an EPERM error.
I've worked around this by keeping a set of file descriptors that produce this error and automatically adding these to the result of a select call from Self as being readable and writable.
Longer term it might be worthwhile investigating how to get asynchronous i/o working with regular files on Linux to improve performance in i/o bound apps.
In the meantime the workaround means that there is a limit of 1024 open regular files but no limit to the number of sockets and other similar file types.
Links: ------ [1] http://groups.yahoo.com/group/self-interest/post;_ylc=X3oDMTJwdWFpbGVpBF9TAz... [2] http://groups.yahoo.com/group/self-interest/post;_ylc=X3oDMTJldnU5ZWRoBF9TAz... [3] http://groups.yahoo.com/group/self-interest/message/3018;_ylc=X3oDMTM0NXMxMj... [4] http://groups.yahoo.com/group/self-interest;_ylc=X3oDMTJlcjhsZTkyBF9TAzk3MzU... [5] http://groups.yahoo.com/group/self-interest/members;_ylc=X3oDMTJmMWh0cm5rBF9... [6] http://groups.yahoo.com/;_ylc=X3oDMTJkYmg4amoxBF9TAzk3MzU5NzE0BGdycElkAzExMT... [7] http://info.yahoo.com/privacy/us/yahoo/groups/details.html [8] http://info.yahoo.com/legal/us/yahoo/utos/terms/
Russell Allen mail@russell-allen.com writes:
Are there any Self-side changes needed or just the VM?
Just VM changes. The epoll implementation fits the abstraction the Self VM is using to wrap select.
self-interest@lists.selflanguage.org