Page 1 of 1

What happens if counting SEMAPHORE overruns

PostPosted: Tue Sep 03, 2002 9:19 am
by luben
Hello,

What will happen if 8 bit counting semaphore was signalled let's say 256 times? Will semaphore still stay signalled (the counter value is zero)? And what will get the task that waits this semaphore?

Is it dangerous to signal semaphores very frequently? I mean - if there is overrun of the counter, will it show that the semaphore is signalled |MODULE 256| times?

Regards
Luben


Re: What happens if counting SEMAPHORE overruns

PostPosted: Tue Sep 03, 2002 9:26 am
by aek
Hi Luben.

The counting semaphore will "max out" and stay there. OSSignalSem() will return OSERR_EVENT_FULL.

For an 8-bit sempahore, it will max out at 255 ...

So, if a counting semaphore is already at 255 and you call OSSignalSem(), it will simply return the error code and take no further action.

Regards,

------------------


Re: What happens if counting SEMAPHORE overruns

PostPosted: Tue Sep 03, 2002 10:21 am
by luben
Hello,

Seems that SALVO is not only well made like services, but has excellent protection against wrong situations :-)

Regards
Luben

[This message has been edited by luben (edited September 03, 2002).]