Re: Stack and Thread Safety
From: Chris Smith (cdsmith_at_twu.net)
Date: 06/30/04
- Next message: Andrew Thompson: "Re: Getting mouse coordinates OnClick"
- Previous message: V S Rawat: "Re: Simple Display problem ...."
- In reply to: Sebastian Scheid: "Re: Stack and Thread Safety"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Jun 2004 08:07:42 -0600
Sebastian Scheid wrote:
> No you cannot. Stack could have thread unsafe parts in it. But in fact it
> has not. Its methods are synchronized. So Stack is threadsafe but not
> because in extends Vector!
It's worth pointing out here that "thread-safe" is a rather vague term
here. To reason about correctness of a multithreaded program, you need
to do more than ask if everything you use is "thread-safe". For
example, if I needed to push three values consecutively onto a stack,
I'd still need to take out a monitor on that stack to ensure that the
set of tree push operations are atomic.
-- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
- Next message: Andrew Thompson: "Re: Getting mouse coordinates OnClick"
- Previous message: V S Rawat: "Re: Simple Display problem ...."
- In reply to: Sebastian Scheid: "Re: Stack and Thread Safety"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|