Pumpkin, Inc.

Pumpkin User Forums

What happens if counting SEMAPHORE overruns

If you have a general question or comment regarding Salvo, post it here.

What happens if counting SEMAPHORE overruns

Postby luben » Tue Sep 03, 2002 9:19 am

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

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: What happens if counting SEMAPHORE overruns

Postby aek » Tue Sep 03, 2002 9:26 am

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,

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: What happens if counting SEMAPHORE overruns

Postby luben » Tue Sep 03, 2002 10:21 am

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).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron