On 08/05/10 20:13, John Gilmore wrote: > If this code is only called 50 times a second or something (whatever > the frequency of the main loop is), then it should just poll the file > descriptor with select or FIONREAD. It appears to do the FIONREAD > anyway, so might as well entirely remove the select.
I've tried it both ways today, and don't really see a big difference in performance, but this is on a fast machine. I'll try on something slower when I get a chance. > When no packet is there to process, there isn't any reason to delay > the rest of gnash by 100 microseconds. Even if the kernel was good at > using such tiny delays, which it isn't. At one time I was seeing weird timing issues on some machines where the network wasn't ready in time for the ioctl() call, to check the size. Maybe that was just an artifact of something else. Plus I do have a habit of always using select() before any network operation to make sure the interface is ready. Ideally, the select() shouldn't be necessary. I found another subtle bug while looking at this, so I'll be digging into this more. > If this code is called more frequently than that, it should probably > use the main select() loop (and create a main select() loop for the > framebuffer GUI, there are good reasons why every other GUI does this). I'll think about for the framebuffer GUI post release, as I'll be doing other work to it. The problem with the main select loop is it's event based, and jumps to a callback. That way it gets ugly to access the movie_root data to make method calling, etc... actually work. By being deep inside the movie_root advance, if there is a remote function, it's then easy to do something with it. Some of the other AS classes work the same way for the same reason. - rob - _______________________________________________ Gnash-dev mailing list Gnash-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-dev