Race Conditions
I have developed a module and in the init_module function i register two functions to two hooks -NF_IP_LOCAL_IN and NF_IP_POST_ROUTING. In the two functions i am acesssing a global data structure. Is it possible for me to have race condition while accessing the data structure or can I be sure that while one function is executing another will not because they are both running at the same IRQ level which is below the schedular, and hence cannot interupt each other. Is this assumption correct.
any coments, suggestions and pointers are appreciated.
regards,
Asad
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Quoted 10 lines · A K A
I have developed a module and in the
init_modulefunction i register two functions to two hooks -NF_IP_LOCAL_IN andNF_IP_POST_ROUTING. In the two functions i am acesssing a global data structure. Is it possible for me to have race condition while accessing the data structure or can I be sure that while one function is executing another will not because they are both running at the same IRQ level which is below the schedular, and hence cannot interupt each other. Is this assumption correct.
no, you cannot. All netfilter code needs to be SMP-safe and you can have two threads in the same softirq context (netfilter runs in softirq context).
Quoted 2 lines
regards,
Asad
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie