[icecast-dev] redundant code ?

Mihai RUSU dizzy at roedu.net
Wed Feb 11 23:37:38 PST 2004



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 12 Feb 2004, Michael Smith wrote:
> >
> > Is this code redundant ?
> 
> No. The first check comes early - it allows us to reject the client 
> immediately if there's no chance of it being allowed in.

Ok.

> Then, in the second check, we've already found the source that this client is 
> being connected to, and we check again - this time, if the check succeeds, 
> the global client count is incremented.

You mean that beeing multithreaded application the counter may have been 
incremented from the last check so better to check it again just before 
increment (while holding a lock on it). Thanks, Im having dificulties 
understanding all this as I have never (yet) programmed multi-threaded 
applications heh :)

> Mike

- -- 
Mihai RUSU                                    Email: dizzy at roedu.net
GPG : http://dizzy.roedu.net/dizzy-gpg.txt    WWW: http://dizzy.roedu.net
                       "Linux is obsolete" -- AST
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAKy1DPZzOzrZY/1QRApkGAJ9rHzDTNnPYa+ej7bzwDOYMRqByXgCdEt2b
MW9hnghEfQadp/3Y+kAC/po=
=pwi1
-----END PGP SIGNATURE-----
--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast-dev mailing list