C
clqrq
i have just a little question:
guess i have a class with a static function [lets say CA::static()] and
i have different threads running. do i have to expect the problem that
2 treads try to acces CA::static() at the same time or does the
processor always make shure that one of them has to wait till the other
finishes? or may it be that a static func can be executed twice at the
same time? or should i implement something like:
bool CA::fInUse = false;
CA::static() {
while (fInUse) ;
fInUse = true;
// do something //
fInUse = false;
}
guess i have a class with a static function [lets say CA::static()] and
i have different threads running. do i have to expect the problem that
2 treads try to acces CA::static() at the same time or does the
processor always make shure that one of them has to wait till the other
finishes? or may it be that a static func can be executed twice at the
same time? or should i implement something like:
bool CA::fInUse = false;
CA::static() {
while (fInUse) ;
fInUse = true;
// do something //
fInUse = false;
}