[Tutor] Help with daemon
Alberto Troiano
albertito_g at hotmail.com
Wed Apr 27 23:35:43 CEST 2005
Hi everyone
Again disturbing the peace of the TUTOR :D
I'm making an application to check every few seconds for photos uploaded via
ftp
The users will program their upload time via web page (made in php). The
time is saved in a MySQL database so I will check for all the created users
if they are in record time. I'm applying a security politic that when the
users are in record time then the ftp will let them write and erase, but
when they aren't the ftp only will let them read.
Here is my problem. Imagine 100 users and lets say that User A connects at
9:00 and User B will connect at 9:10. When I first check at 9:00 User A is
in record time so he can send photos but User B does not. The program will
have to check for all 100 users and will hardly reach for another check at
9:10 and it will loss transfer time. The OS is linux and the version of
Python is 2.2.3.
The question is, how can I make the application to manage a process for each
user the database find, so only one process will attend one user and I think
it will be fast enough to cover the record time.
I don't know if my approach is right, I'm new with multithreading and I will
appreciate the help.
I'm gonna give you an example:
The program will check for new users and to check record time every 10
seconds. But first the program will have to finish the checking process that
started before so it won't be 10 seconds right?
Unless I have one process for each user to check the database at the same
time is checking other users
Thanks for the help and I hope this is clear (and not long) enough for you
to help me
Regards
Alberto
More information about the Tutor
mailing list