Hi, > Do you think mallocing an fd_set and using FD_SET() and friends > would be better? The (dispose|finish) loops would visit FD_SETSIZE bits > with an FD_ISSET() test, which is more work than you have currently > with the early out, but we would probably save on the initialization > with FD_ZERO(). I don't know if lxc_cgroup_(dispose|finish)_attach is > performance critical.
I don't think performance is that much of an issue here, but to me it seems that using fd_set logic would complicate things quite a bit unnecessarily. The current logic is already a bit complicated because the cgroup task files have to be opened before setns() but written to only after the fork() call when we know the pid which happens after setns(). Having a simple array with a loop over it appears to be much more straight-forward to me, especially since iterating over an fd_set is kind of convoluted. > Or I can just add a comment :) My suggestion would be to do just that unless someone has a good reason to change the current logic. All IMHO of course, I just wrote the initial patch, in the end other people get to decide what goes in. ;-) Regards, Christian ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel