Google Answers Logo
View Question
 
Q: Help in scheme ( No Answer,   0 Comments )
Question  
Subject: Help in scheme
Category: Computers > Programming
Asked by: mott85-ga
List Price: $15.00
Posted: 14 Nov 2004 15:33 PST
Expires: 18 Nov 2004 20:08 PST
Question ID: 428923
I need tsome hlep finding an answer to soemthing in scheme. This is
not a homework problem and top prove it i will post my orginal code if
any one can help I appreciate it.

A semaphore (of size n) is a generalization of a mutex. Like a mutex,
a semaphore supports acquire and release operations, but it is more
general in that up to n processes can acquire it concurrently.
Additional processes that attempt to acquire the semaphore must wait
for release operations. Give implementations of semaphores in terms of
mutexes and in terms os atomict-test-and set.

Here is what i think i need to do for setting mutxes is therre
somehwre i can confirm this?

(define (make-mutex)
  (let ((cell (list false)))            
    (define (the-mutex m)
      (cond ((eq? m 'acquire)
             (if (test-and-set! cell)
                 (the-mutex 'acquire))) ; retry
            ((eq? m 'release) (clear! cell))))
    the-mutex))
(define (clear! cell)
  (set-car! cell false))
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy