Need some help on CS stuff: Semaphores

sdaccord01

Senior member
Jul 9, 2003
291
0
0
Hi,

I'm taking a CS class over the summer and this problem is bugging me:

Implement a binary semaphore with general semaphores.

I have to do this using pseudocode but I don't know if it's possible since I've googled for a while and have only come up with implementing a general semaphore using binary semaphores. Can anyone please help me?

Ken
 

Chu

Banned
Jan 2, 2001
2,911
0
0
Originally posted by: sdaccord01
Hi,

I'm taking a CS class over the summer and this problem is bugging me:

Implement a binary semaphore with general semaphores.

I have to do this using pseudocode but I don't know if it's possible since I've googled for a while and have only come up with implementing a general semaphore using binary semaphores. Can anyone please help me?

Ken

These are called "Mutex Locks". I have source somewhere that implements them, but it uses SPARC asm instructions because you obviously need to enforce atomic operations at the hardware level since you can't call the library you are writing to enforce atomic operations at software level ;)

-Chu

EDIT : Whoops, didn't read your post well enough, but searching mutex locks would help. I think I'm misunderstanding the problem though because as stated it makes little sense . . .