comp.lang.ada
 help / color / mirror / Atom feed
From: Jim Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Complexity of protected objects
Date: Fri, 01 Mar 2002 05:45:04 GMT
Date: 2002-03-01T05:45:04+00:00	[thread overview]
Message-ID: <3C7F1559.5080304@worldnet.att.net> (raw)
In-Reply-To: dale-1C20CF.10324101032002@its-aw-news.its.rmit.edu.au

Dale Stanbrough wrote:

> Jim Rogers wrote:
> 
> 
>>Using a protected object to read and write files is a clear
>>violation of the intention and recommendations for proctected
>>objects. Protected objects should be non-blocking. I/O is
>>always potentially blocking.
>>
> 
> Why is this? I see this as being a piece of programming advice,
> - it's not a good idea to hold locks for a long time - but is 
> there any more to it than that? Are there some other consequences
> of scheduling than that?


It is good to understand why "it's not a good idea to hold locks
for a long time". The first reason that comes to my mind is the
need to avoid live locks and dead locks in your system.

Note that this is an entirely different issue from queueing up
protected entry calls because the entry guard is closed. Protected
entries are used to communicate state as well as data between tasks.

Blocking actions belong in separate tasks. Unless you are using
FSU threads this should allow other tasks to procede while one
task is blocked. Blocking during communication between tasks
often has a cascading effect throughout a system.

Jim Rogers




  reply	other threads:[~2002-03-01  5:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-25 16:28 Complexity of protected objects tony gair
2002-02-25 16:45 ` Marin David Condic
2002-03-03  1:11   ` Robert Dewar
2002-03-03  4:13     ` Dale Stanbrough
2002-03-03 19:50       ` Robert Dewar
2002-02-25 17:35 ` Jim Rogers
2002-02-28 22:09   ` Nick Roberts
2002-02-28 23:32     ` Dale Stanbrough
2002-03-01  5:45       ` Jim Rogers [this message]
2002-03-03  0:59       ` Robert Dewar
2002-03-01 17:42     ` Jeffrey Carter
2002-03-03  1:06       ` Robert Dewar
2002-03-03  6:53         ` Jeffrey Carter
2002-03-03 19:36           ` Robert Dewar
2002-03-04 20:04             ` Jeffrey Carter
2002-03-03  0:54     ` Robert Dewar
2002-03-03  0:32   ` Robert Dewar
2002-02-25 22:01 ` Ted Dennison
2002-03-03  1:08   ` Robert Dewar
2002-03-04  9:33     ` Dmitry A. Kazakov
2002-03-04 16:44       ` Ted Dennison
replies disabled

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