Creative Reality Pty Ltd

Creating a new reality

  • Increase font size
  • Default font size
  • Decrease font size

Creative Reality Pty Ltd provides the following services. Contact us for information on availability.

Consulting

May 2010: Currently available.

Creative Reality provides consulting services for a wide range of computer, embedded and Internet technologies.

Our background is in reliable efficient multi-threaded real-time embedded systems; from the software running in fighter aircraft computers to multi-media fiber-optic digital switches and telecommunications equipment. We have also designed and written a highly efficient preemptive real-time embedded operating system optimized for running actor style tasks. A lot of this work was done in C++/C.

More recently we have been working on Internet-based solutions; including participation on one of the international web standards committees. A lot of recent work has been done on the Java platform using Scala, JavaFX, Groovy and Java; using related technologies like Swing/JavaFX for GUI, JDO for persistence to databases and Java3D for 3D graphics.

Creative Reality generally works on R&D projects and has been involved in more mathematical areas like image processing, weapon trajectory calculations, signal processing and combinatorial optimizations.

Currently we are developing a fast combinatorial optimization solution for useful scheduling.

See the technologies page for more details.

 

Current/Recent projects:

  • Developing an RFID/NLIS livestock database system for outdoor (in-paddock) use.
    • JavaFX, Scala, Groovy and Java with Datanucleus (JDO) persistent objects to PostgreSQL.
  • Finalizing proof of concept for a social collaboration concept system.
    • Scala and Java very fast concurrent combinatorial optimization algorithm for multi-core processors.
  • Investigating STMs for use on multicore processors to implement complex algorithms on multicore processors.
    • developed a number of STMs using Scala and Java - even with (probably the fastest STM on the JVM) my STM on an Intel quad-core i7, performance is slower than a single thread requiring no concurrency overhead.


Tutoring

May 2010: Currently available.

Creative Reality provides tutoring services for high school maths, physics and computer related studies.

 

Language Teaching    中英文家教

May 2010: Mostly full, book soon if you are interested.

Creative Reality provides teaching services for Chinese/Mandarin and English (ESL).

更多信息,请点击




Recent Articles

 

STM Overview

E-mail Print

This article is a description of a simple software transaction memory (STM) I wrote in Scala in order to better understand STMs. I'll start with a summary of performance and then go into some details. For a good introduction to writing an STM in Scala, look at the article in code commit. These are all MVCC-style STMs that guarantee transactions read from a consistent snapshot of data. Unlike other similar approaches, they don't allow write-skew - so your transactions give the same result running in parallel as they would if they ran serially; no surprises. The all provide nested transactions.

 

9.5 million transactions / second

very optimistic for low contention transactions

uses CAS instead of locking

snapshot history is limited to allow good garbage collection performance - meaning some transactions may retry due to not finding the required history

 

4.5 million transactions / second

pessimistic, transactions are isolated until commit time

uses locking instead of CAS - better for high concurrency implementations

also has limited snapshot history for good, fast GC performance

 

3.5 million transactions / second  (new alpha version)

has precise snapshot history management - you can start a transaction, sleep for a year, then continue on - the transaction will still be able to access a full snapshot history, using minimal memory to store the snapshot - based on a distributed snapshot tree for concurrent updating - read only transactions never retry

 

This is running on a 2.8GHz quad-core i7-860, Java 6u20. Basic test of 1024 accounts, each transaction moves a random amount of money from one random account to another. There is also one transaction that periodically sums all the accounts and ensures that no money is lost or gained. The test is aimed at finding the overhead of the STM, nothing more. STMs aren't good for many conflicts, so the conflicts are kept relatively low.

The snapshot history is guaranteed to be available for every transaction running in the system, they grow to the correct length, no longer and no shorter than required. This is different to, say Clojure, which keeps more history than needed for most transactions and fails transactions that need more history than available. Clojure adjusts history length after a failure. It's harder to design a system like Clojures; correct lengths are easier and have less overhead. But you can do insane things like start a transaction, wait for 1 second, then sum all accounts. With other threads running at 7M tx/sec, histories are thousands of values long.

Last Updated on Sunday, 04 July 2010 12:42 Read more...
 

GC History List

E-mail Print

The MVCC STM keeps a history of old Ref Values. This needs to be managed so the list doesn't get too long. You would think there is a way to have the Garbage Collector do the work of getting rid of old values that are no longer required. After some designing, then thinking, then more designing, I found a way that makes this work quite nicely.

The Garbage Collected History List

I couldn't find a reference to anything like this - I guess I don't know the right keywords to Google on. Anyway, a fundamentally simple concept that allows the tail of a list to be GC'd at the point where there are no references to the list below that point.

Perfect for a history where you only need to keep values that are still possibly likely to be used.

 

Last Updated on Sunday, 23 May 2010 01:40
 

MVCC STM GC'd Ref History

E-mail Print

When writing an MVCC-based STM I found that managing the value history on the Ref object was an issue. I needed to keep just enough history in memory for all transactions to access the appropriate values. This initially seemed to be an annoying problem to solve as the garbage collector would potentially GC too much of the history list. But after some thought I designed a way to have the garbage collector GC the right amount of the history list.

Other than being an interesting problem solved, I didn't think much more of it until I saw that the Clojure STM implementation manually tries to manage it's Ref history list. If the list is too small the transaction is retried and the list for that Ref is lengthened. A guess is made as to how long lists should be, so it's likely that the lists are a bit longer than required. I didn't look in to the implementation to see exactly what they are doing or how much extra code is required to get it to work, but either way it sounds unnecessarily complicated and inefficient. The GC is the best system to manage these sorts of lists.

The GC-based solution is very simple, doesn't require much code or memory overhead and more importantly, it's just correct. What needs to be in memory is in memory, what isn't needed is removed.

Last Updated on Wednesday, 26 May 2010 00:38 Read more...
 

STM Thoughts

E-mail Print

STM (Software Transactional Memory) appears like a good way to make use of multicore processors. It has the advantage that writing complex concurrent software is very easy for certain types of problems. But the overhead of implementing STM means that it may actually run slower on an 8-processor system (say hyperthreaded dual core i7) than a single threaded dedicated process. 

The advantage of writing a single threaded solution is that there is no need for blocking and hence task-switching; there is no reason to synchronize local cache with main memory; and the JIT optimizer can do maximum optimization as there are no volatile variables that can't be cached and no reason to not re-order instructions optimally.

 

Last Updated on Tuesday, 18 May 2010 16:13 Read more...