home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / parallel / 1931 < prev    next >
Encoding:
Text File  |  1992-08-17  |  6.3 KB  |  150 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!destroyer!gatech!hubcap!fpst
  3. From: cmcl2!vlsi3.ultra.nyu.edu!freudent@uunet.UU.NET (Eric Freudenthal)
  4. Subject: Re: Is the overhead of spin lock acquisition always significant?
  5. In-Reply-To: Ian Heavens's message of Tue, 18 Aug 1992 10:47:12 GMT
  6. Message-ID: <1992Aug18.200454.19748@hubcap.clemson.edu>
  7. Sender: cmcl2!notes@uunet.UU.NET (Notes Person)
  8. Nntp-Posting-Host: vlsi3.ultra.nyu.edu
  9. Cc: freudent@lab.gottlieb@lab.edler@LAB.ULTRA.NYU.EDU
  10. Organization: /a/users/freudent/.organization
  11. References: <1992Aug18.111938.19628@hubcap.clemson.edu>
  12. Date: Wed, 19 Aug 1992 00:33:59 GMT
  13. Approved: parallel@hubcap.clemson.edu
  14. Lines: 134
  15.  
  16. Ian,
  17.  
  18. In article <1992Aug18.111938.19628@hubcap.clemson.edu> Ian Heavens <ian@spider.co.uk> writes:
  19.  
  20.    Newsgroups: comp.parallel
  21.    Path: cmcl2!yale.edu!jvnc.net!darwin.sura.net!paladin.american.edu!gatech!hubcap!fpst
  22.    From: Ian Heavens <ian@spider.co.uk>
  23.    Apparently-To: comp-parallel@uunet.uu.net
  24.    Sender: USENET News System <news@spider.co.uk>
  25.    Nntp-Posting-Host: redknee.spider.co.uk
  26.    Organization: Spider Systems Limited, Edinburgh, UK
  27.    Date: Tue, 18 Aug 1992 10:47:12 GMT
  28.    Approved: parallel@hubcap.clemson.edu
  29.    Lines: 40
  30.  
  31. You wrote:
  32.  
  33.     I'd like to question one of the sacred cows of spin-lock based shared 
  34.     memory multiprocessing: that the number of spin locks acquired should be 
  35.     minimised, because the overhead in lock acquisition is significant.
  36.  
  37. I agree.  That rule is too simple.  Clearly, you want to avoid
  38. unecessary work.  Determining the granularity of locking that is
  39. appropriate for a particular problem can be difficult. 
  40.  
  41.     I agree that contention is always significant, and that there are good
  42.     other reasons for not having lots of locks (clarity and deadlock
  43.     avoidance).  Also, in some applications, the overhead of lock
  44.     acquisition may be significant, where the critical sections are
  45.     very short and are executed very frequently.
  46.  
  47. Actually, I have heard a related argument for why you would want lots
  48. of locks rather than a few.
  49.     
  50.     In our application, a TCP/IP protocol stack, the difference between
  51.     acquiring 5 and 10 locks on a typical input or output path seems to me
  52.     to be insignificant compared to the protocol processing, assuming no
  53.     contention for those locks.  
  54.     
  55.      This issue becomes important because multiple-reader/single-writer
  56.     locks are much more convenient to use, and reduce contention, at
  57.     a cost of increasing the overhead (three times that of a mutex lock?).
  58.     
  59. What atomic operations does the machine that you are using support?
  60. Reader/Writer coordination becomes much easier if you have either an
  61. atomic add (fetch and add) or increment/decrement operation:
  62.     
  63. With fetch & add, only one shared access is required to acquire or
  64. release either lock if there is no contention.  (I can send you this
  65. code).
  66.     
  67. With fetch&increment and fetch&decrement (or even, atomic increment
  68. and decrement that indicate if the value - either before the operation
  69. or afterwards - was zero), only two shared accesses are required to
  70. acquire or release either lock if there is no contention.  (This code
  71. appeared in last year's ASPLOS ("Process Coordination with Fetch and
  72. Increment" by me and Allan Gottlieb; I can send it to you).
  73.     
  74.    Are their cache consistency or other reasons to inflate the overhead
  75.    of testing and setting a memory location?  What have I missed?
  76.     
  77.    Can someone suggest a rough equivalent for a spin lock acquisition in
  78.    terms of (some arbitrary mix of) instructions execution, where both 
  79.    instruction and data fetch are cache hits?
  80.  
  81. Such an algorthm (one that only references data in a local cache in
  82. all cases) can not be constructed because (I assume) more than one
  83. processor may access a particular lock.  If the lock's state variable
  84. is changed by two processors, then at least one of them needs to do a
  85. remote access.
  86.  
  87. For this reason, memory that is actively shared (such as state
  88. variables for a contended-for lock) is much harder to cache
  89. efficiently than memory that is mostly used by a single processor for
  90. a long period of time.
  91.  
  92. original author:
  93.    ---
  94.    Ian Heavens                ian@spider.co.uk                 
  95.    Spider Software
  96.    Spider Park, Stanwell Street        
  97.    Edinburgh, EH6 5NG, Scotland        +44 31 555 5166 (Ext 4347)
  98.    --
  99.  
  100.  
  101. If you reply to me, PLEASE use the address in my signature, not the
  102. account that I mailed this from.
  103.  
  104. Good luck,
  105. Eric
  106. --
  107.  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  108.                 Eric Freudenthal
  109.                 NYU Ultracompter Lab
  110.                 715 Broadway, 10th floor
  111.                 New York, NY  10003
  112.                 
  113.                 Phone:(212) 998-3345 work
  114.                       (718) 789-4486 home
  115.                 Email:freudent@lab.ultra.nyu.edu
  116.  
  117. Newsgroups: comp.parallel
  118. Approved: parallel@hubcap.clemson.edu
  119. From: jf@edv6000.tuwien.ac.at (Josef Fritscher (58801-5505))
  120. Subject: Re: PVM: thoughts on data-passing routines
  121. Sender: news@email.tuwien.ac.at
  122. Nntp-Posting-Host: edv6000.tuwien.ac.at
  123. Reply-To: fritscher@email.tuwien.ac.at
  124. Organization: Technical University of Vienna
  125. References:  <1992Aug11.121234.28784@hubcap.clemson.edu> <1992Aug17.140351.23197@hubcap.clemson.edu>
  126. Date: Tue, 18 Aug 1992 12:02:34 GMT
  127. Apparently-To: comp-parallel@news.uu.net
  128.  
  129. In article <1992Aug17.140351.23197@hubcap.clemson.edu>, zink@phoenix.informatik.uni-stuttgart.de (Roland Zink) writes:
  130. |> In article <1992Aug11.121234.28784@hubcap.clemson.edu>, jek@cs.duke.edu (James E. Kittock) writes:
  131.  
  132. |> In my Stuttgart Parallel Processing Library (SPPL) this is possible. 
  133.  
  134. I always wonder why so much people invent their own stuff instead of using
  135. the more populuar ones (like PVM) and improve them without loss of
  136. portability... (Just my $ 0.02)
  137.  
  138. Joe
  139. -- 
  140. Josef Fritscher                     Internet: fritscher@edvz.tuwien.ac.at
  141. Computing Center                      Bitnet: fritscher@awituw64.bitnet
  142. Technical University of Vienna    in reality: jf@edv6000.tuwien.ac.at
  143. Wiedner Hauptstrasse 8-10              Voice: ++431 58 801/5505
  144. A-1040 Vienna, Austria/Europe         Fax: ++431 58 74 211 
  145. Member of the Austrian Center for Parallel Computation (ACPC)
  146. -------------------------------------------------------------------------
  147. The function of local-in-Universe critical information-gathering and
  148. local-in-Universe problem-solving is manifest in the cockpit of all
  149. great airplanes.                                  (R. Buckminster Fuller)
  150.