tag:blogger.com,1999:blog-17087850.post3790938001656451772..comments2023-10-31T06:50:41.697-04:00Comments on Factor: a practical stack language: What's up with non-blocking I/O APIs?Slava Pestovhttp://www.blogger.com/profile/02768382790667979877noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-17087850.post-75607173581217691022008-01-28T15:49:00.000-05:002008-01-28T15:49:00.000-05:00Regarding epoll, I believe it's more efficient tha...Regarding epoll, I believe it's more efficient than select or poll for huge numbers of file descriptors...Anonymoushttps://www.blogger.com/profile/17265797060358625981noreply@blogger.comtag:blogger.com,1999:blog-17087850.post-53415674024805279162008-01-28T07:57:00.000-05:002008-01-28T07:57:00.000-05:00Man, I wish the linux kernel people had gone with ...Man, I wish the linux kernel people had gone with kqueue instead of inventing their own less-powerful thing.<BR/><BR/>The reason for preferring kqueue()/epoll() over poll() or select() for file descriptors is that they can efficiently deal with far more descriptors.<BR/><BR/>The BSD kqueue(), of course, can deal with a lot more types of events than just fd activity.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17087850.post-26015464793328213862008-01-27T07:15:00.000-05:002008-01-27T07:15:00.000-05:00FYI, you can't select() files on Linux. Well, you ...FYI, you can't select() files on Linux. Well, you can but it will always indicate readable+writable.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-17087850.post-12989083326752842282008-01-24T18:05:00.000-05:002008-01-24T18:05:00.000-05:00Steve: you're right, Factor has lightweight co-ope...Steve: you're right, Factor has lightweight co-operative threads.<BR/><BR/>At some point we're adding native threads but even then we'll still support lightweight threads (ie, M:N threading) so having good non-blocking I/O is a long-term requirement.Slava Pestovhttps://www.blogger.com/profile/02768382790667979877noreply@blogger.comtag:blogger.com,1999:blog-17087850.post-82283146506816624872008-01-24T18:02:00.000-05:002008-01-24T18:02:00.000-05:00Nick: libevent and so on have the same problems be...Nick: libevent and so on have the same problems because they use the same underlying OS APIs.Slava Pestovhttps://www.blogger.com/profile/02768382790667979877noreply@blogger.comtag:blogger.com,1999:blog-17087850.post-48926895129075418462008-01-24T15:13:00.000-05:002008-01-24T15:13:00.000-05:00I take it you don't want an external dependency on...I take it you don't want an external dependency on a lib like libevent, liboop, or libev?Unknownhttps://www.blogger.com/profile/09683565159634707760noreply@blogger.comtag:blogger.com,1999:blog-17087850.post-15861573888020213332008-01-24T09:41:00.000-05:002008-01-24T09:41:00.000-05:00I imagine it would not be as efficient to implemen...I imagine it would not be as efficient to implement bio using nbio in user space. However, if async-io was used then I imagine it is as efficient (same number of sysops). It's the memcopy from kernel to user space that I'm thinking of on a read...<BR/><BR/>Why do you need continuations/corourtines to implement bio in user space over nbio? Couldn't you just loop and poll? I imagine that continuations/coroutines are only need to implement some kind of featherweight thread system...Anonymoushttps://www.blogger.com/profile/06340403723350864929noreply@blogger.com