Pumpkin, Inc.

Pumpkin User Forums

Behaviour of Semaphores

If you can't make Salvo do what you want it to do, post it here.

Behaviour of Semaphores

Postby luben » Sat Jan 06, 2001 9:45 am

Hello,

Semaphores are like counters that increment their value when signaling and decrement - when a task was waiting for them and get the event.

My question is - if the counter overflow (too many signaled semaphores), what will happen. It's logical that OSSignalSem() will return error code, right?

Regards
Luben

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

Re: Behaviour of Semaphores

Postby aek » Sat Jan 06, 2001 11:08 am

When OSSignalSem() is called and the semaphore is already at its maximum value (e.g. 255 for 8-bit semaphores), then OSSignalSem() returns OSERR_SEM_MAX and no further action is taken.

This is covered in the Reference section of the User Manual.

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


Return to Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron