Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* memory barrier help
@ 2001-01-04 14:09 Daniel Christians
  2001-01-05  5:32 ` Rajanish Calisa
  2001-01-05 13:45 ` Bob Koehler
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Christians @ 2001-01-04 14:09 UTC (permalink / raw)


hi,

is there a doc, or can someone explain why a
a user application program which uses pthreads 
(DECthreads) would need to use the memory barrier
instruction? (or alternatively the wmb instruction).
the application happens to be the java vm.

thanks much,

dan christians


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: memory barrier help
  2001-01-04 14:09 memory barrier help Daniel Christians
@ 2001-01-05  5:32 ` Rajanish Calisa
  2001-01-05 13:45 ` Bob Koehler
  1 sibling, 0 replies; 3+ messages in thread
From: Rajanish Calisa @ 2001-01-05  5:32 UTC (permalink / raw)



Daniel Christians <danielc@minbar.zko.dec.com> wrote in message
news:3A548425.2E4007A3@minbar.zko.dec.com...
> hi,
>
> is there a doc, or can someone explain why a
> a user application program which uses pthreads
> (DECthreads) would need to use the memory barrier
>
For a treatment of memory barriers etc, read Unix for multiprocessors
by Curt Schimmel. Any decent pthread programming book should
talk about it: E.g. Programming Posix threads by D Butenhof.
The books explain why they are required. Also check out
Sun Multi-threaded programming guide on Sun web site. You
can do a search for it.

pthread calls like mutex_lock(), mutex_unlock(), pthread_create()
etc., introduce memory barriers, and normally an application
programmers do not need to worry about it, since the
mechanisms differ from platform to platform.

> instruction? (or alternatively the wmb instruction).
> the application happens to be the java vm.
>
> thanks much,
>
> dan christians




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: memory barrier help
  2001-01-04 14:09 memory barrier help Daniel Christians
  2001-01-05  5:32 ` Rajanish Calisa
@ 2001-01-05 13:45 ` Bob Koehler
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Koehler @ 2001-01-05 13:45 UTC (permalink / raw)


In article <3A548425.2E4007A3@minbar.zko.dec.com>, Daniel Christians <danielc@minbar.zko.dec.com> writes:
> hi,
> 
> is there a doc, or can someone explain why a
> a user application program which uses pthreads 
> (DECthreads) would need to use the memory barrier
> instruction? (or alternatively the wmb instruction).
> the application happens to be the java vm.
> 

IIRC DECthreads can run threads simultaneously on different CPUs in an
SMP machine.  The only way one thread can know that another thread sees
a consistent set of data is via a memory barrier.

On a single CPU system the memory barrier is only really needed when
passing data off to an external device (all Alphas always need to work
like multi-processor machines due to this).  The code in DECthreads is
probably generic and does the MB's any time data could be passed from
thread to thread.

----------------------------------------------------------------------
Bob Koehler                     | Computer Sciences Corporation
NASA GSFC Flight Software       | Federal Sector, Civil Group
                                | please remove ".aspm" when replying


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-05 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-04 14:09 memory barrier help Daniel Christians
2001-01-05  5:32 ` Rajanish Calisa
2001-01-05 13:45 ` Bob Koehler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox