comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Advice, tasking and hardware
Date: Thu, 26 May 2016 09:26:03 +0200
Date: 2016-05-26T09:26:03+02:00	[thread overview]
Message-ID: <ni68f8$1t85$1@gioia.aioe.org> (raw)
In-Reply-To: 25c43463-47ca-4021-82ee-299e6a075faa@googlegroups.com

On 25/05/2016 23:24, patrick@spellingbeewinnars.org wrote:

> Do you have any examples of tasking calling low level functions?

Just call it as any other subprogram.

> Spark doesn't use tasking, are there many dangers in using tasking with hardware?

Dangers to the hardware? (:-))

Pre-/postcondition based proofs (SPARK's business) are pretty much 
orthogonal to tasking issues. Schedulability and other tasking stuff has 
a non-functional aspect whereas proofs are about functional issues. If 
you are concerned about static analysis regarding tasks, see Ravenscar 
profile.

> Would it be wise to wrap C driver calls in a protected object or are
> most drivers in Linux thread safe and suitable for being called from
> different threads?

Driver calls are thread safe. It does not mean that they are safe from 
the higher level semantics point of view. E.g. it is safe to delete a 
file in one process and open it in another, safe at the filesystem 
level, but unsafe at the application level.

Anyway, you never call driver operations from a protected action because 
it is a "potentially blocking" call. Even if not blocking in the sense 
of being asynchronous to the CPU/memory bus cycles, accessing hardware 
might be quite slow, e.g. reading/writing a hardware port, dual-ported 
memory access etc. A protected action is considered logically instant.

If you want interlocking for doing blocking calls use a mutex etc. A 
mutex implementation based on protected objects is two actions: Seize 
and Release.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  parent reply	other threads:[~2016-05-26  7:26 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 21:24 Advice, tasking and hardware patrick
2016-05-26  1:09 ` Jeffrey R. Carter
2016-05-26  8:13   ` Simon Wright
2016-05-26  7:26 ` Dmitry A. Kazakov [this message]
2016-05-26 16:41   ` patrick
2016-05-26 17:56     ` Dmitry A. Kazakov
2016-05-26 20:35     ` Jeffrey R. Carter
2016-05-26 19:35   ` Jeffrey R. Carter
2016-05-26 20:51     ` patrick
2016-05-27  7:50     ` Dmitry A. Kazakov
2016-05-27 18:00       ` Simon Wright
2016-05-27 19:06       ` Jeffrey R. Carter
2016-05-27 22:05         ` Randy Brukardt
2016-05-27 23:09           ` Jeffrey R. Carter
2016-05-27 19:13       ` Shark8
2016-05-27 20:27         ` Dmitry A. Kazakov
2016-05-27 22:27           ` Randy Brukardt
2016-05-28  6:49             ` Dmitry A. Kazakov
2016-05-28 14:38           ` Shark8
2016-05-28 15:45             ` Dmitry A. Kazakov
2016-05-28  0:25 ` rieachus
2016-05-28  1:57   ` patrick
2016-05-28  4:13   ` Jeffrey R. Carter
2016-06-01 14:37     ` rieachus
2016-06-01 19:09       ` Dmitry A. Kazakov
2016-06-06  3:33         ` rieachus
2016-06-06  7:18           ` Dmitry A. Kazakov
2016-06-07 16:53             ` rieachus
2016-06-07 20:21               ` Dmitry A. Kazakov
2016-06-08  4:06                 ` rieachus
2016-06-08  7:29                   ` Dmitry A. Kazakov
2016-06-08 12:56                     ` rieachus
2016-06-08  0:19               ` Dennis Lee Bieber
replies disabled

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