Re: VM question related to faults



mykola.stryebkov@xxxxxxxxx wrote:

On 31.07.2006 14:12:20, Intron wrote:

Mutex(9) is sometimes too heavy, and has many limitations, while sx(9)
is somewhat enough.

First paragraph from sx(9) manual says:

Shared/exclusive locks are used to protect data that are read
far more often than they are written. Mutexes are inherently
more efficient than shared/exclusive locks, so shared/exclusive
locks should be used prudently.


--
Nick Strebkov
Public key: http://humgat.org/~nick/pubkey.txt
fpr: 552C 88D6 895B 6E64 F277 D367 8A70 8132 47F5 C1B6
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"

But sx(9) also says in section "CONTEXT",

A thread may hold a shared or exclusive lock on an sx lock while sleep-
ing.

You may try copyout() when holding a mutex(9) on 7.0-CURRENT.
Look out for kernel crash.

------------------------------------------------------------------------
From Beijing, China

_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: all mutexes -> read-write locks?
    ... locking primitives it has come to be that mutexes and exclusively ... acquired reader-writer locks are almost the same in terms of overhead ... by all means change it to use rwlocks. ... changing it would allow a slow transition to using rw locks. ...
    (freebsd-arch)
  • Re: [RFC] locking.9
    ... Sleep Mutexes ... Shared-Exclusive locks ... deschedules the thread while you are holding a SPIN mutex. ... .Ss Sleep Mutexes ...
    (freebsd-current)
  • [RFC] locking.9
    ... Sleep Mutexes ... Shared-Exclusive locks ... deschedules the thread while you are holding a SPIN mutex. ... .Ss Sleep Mutexes ...
    (freebsd-current)
  • Re: locking N mutexes simultaneously
    ... I need to map N mutexes to a sorted array of M mutexes ... acquire locks A B C D E while T2 tries for C E F, ... Lockers of the multimethod simultaneously otherwise I would create ... OBJ queue1 = new; ...
    (comp.programming.threads)
  • Re: Progress on scaling of FreeBSD on 8 CPU systems
    ... If moving away from sleepable mutexes introduces more ... Why don't the sleepable locking primitives perform better? ... My intention is to both get the sx locks changes into the tree so that sx ... John Baldwin ...
    (freebsd-current)