comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Implementation Locks
Date: Sat, 15 Feb 2014 12:20:00 -0800 (PST)
Date: 2014-02-15T12:20:00-08:00	[thread overview]
Message-ID: <a6f65ae0-faf4-45eb-8a9c-f080fde3d58d@googlegroups.com> (raw)

In the past, using other languages, I spent lots of time worrying about whether I should use a spinlock or a semaphore based on how long an sequence of operations was expected to be and how many CPU's were on the system, and wrote lots of overly complicated code to chose the best option in each situation.

Now in Ada, I have difficulty giving up the habit and lay awake at night worrying about whether the implementation is going busy-wait or block for a protected action or closed entry, especially now that everyone has multicore CPU's.  I'm particularly consternated by closed entries, since I doubt the compiler can predict whether it will open back up in several microseconds or in several days.  Is it unreasonable to expect an implementation to use some sort of dynamic, hybrid model that takes into account both how many CPU's are in the system and the average time to wait?  Should I just trust the runtime and try not to worry?  Is there even anything I can do about it either way?

-sb


             reply	other threads:[~2014-02-15 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15 20:20 sbelmont700 [this message]
2014-02-15 21:34 ` Implementation Locks Jeffrey Carter
2014-02-17 12:18 ` G.B.
replies disabled

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