Oh and I forget.
It's a bit more complicated because :
user->idle can be in a "non-timeout' frame while a subuser->idle can be
out of the "TIMEOUT_SEC".
So that, users must be ordered in relation with subuser->idle.
Also, inside the user, subuser should also apply the same sorting for
better perf.
Le 30/05/2011 18:53, Anthony Catel a écrit :
Indeed, this can be improved.
Anyway, this is a kind of improvment I want to work on in APE 2 :
https://github.com/paraboul/APE-Server-v2 and why not doing some
"continuous integration".
If you want or find the time to work on a patch, it would be a
pleasure ;)
Anthony C.
Le 30/05/2011 18:10, iamdog a écrit :
Every 10ms ,check_timeout will be executed.All USERS * pointer will be
enumerate and timeout for user will be checked .If there are many
users , the complexity would be O(n),where n is the user count.
We can use a boost multi-index to sort USERS * by list->idle and list-
subuser->raw_pools.nraw. If one index was sorted by list->idle
descent,we can check if (ctime - list->idle)>= TIMEOUT_SEC then del
user,else stop enumerate the index.The list->subuser->raw_pools.nraw
index can be use in same way. check_timeout function will be executed
fast.
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/