Forum Discussion
Adam_24063
Nimbostratus
Apr 15, 2007synchronization / concurrent access to global variables
Hello again,
I haven't seen any mention anywhere of concurrent access or threading or anything like that. Is this something one needs to think about ?
Are event handlers globally serialized or do they run in parallel ?
Looking at the example rule having to do with limiting connections per client IP address:
when CLIENT_CLOSED {
if { [info exists ::active_clients($client_ip)] } {
incr ::active_clients($client_ip) -1
if { $::active_clients($client_ip) <= 0 } {
unset ::active_clients($client_ip)
}
}
}
I assume that "incr" is atomic (is it ?) but is this check for 0 and the subsequent unset safe ?
if { $::active_clients($client_ip) <= 0 } {
unset ::active_clients($client_ip)
}
i.e. can it be that the value has been incremented by another connection between the time it is checked and the time it is unset?
I assume this would have come up before if it was really an issue since people would have run into it, but I'd like to verify anyway.
thanks,
radu
- hoolio
Cirrostratus
- Adam_24063
Nimbostratus
Thanks for the reply. - Yeah, we are working on that issue. Basically entering in the text field is defaulting to the site wide search field above and not the custom forum search that the forum search box is attached to.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects