Implementing Parallel Processing
StyleTech always aim to create bespoke software systems that are very quick, but simple to use. This is sometimes easier said than done as it does rely on good design and programming techniques to implement successfully. Sometimes it can be as straightforward as adding an index to a database table, but other times the bespoke developer has to implement advanced programming techniques to make this happen.
StyleTech have just completed a bespoke project which needed to generate ten thousand unique codes at a time and those codes should only contain characters / numbers that cannot be mistaken for other characters / numbers, for example the following characters could not be used:
- 1 and l
- 1 and i
- 0 and o
- 2 and Z
- S and 5
- G and 6
The customer’s existing system relied on an overnight batch generation process to generate the ten thousand unique codes, which was having a detrimental effect on the customer’s business. StyleTech devised a bespoke algorithm that can generate ten thousand unique codes and then check that those codes have not already been previously generated by legacy systems.
The initial versions of the bespoke algorithm completed this task on standard PCs in minutes (much better than the customer’s current overnight batch process). StyleTech knew that the bespoke algorithm could be improved as the algorithm was performing all of the work in a sequential process (one thread) and it was not utilising all of the CPU’s that modern PCs contain.
StyleTech then converted the algorithm to use advanced parallel processing techniques, so all of the CPU’s on a modern PC are doing the work at the same time (with multiple threads). The results allowed the StyleTech bespoke algorithm to generate ten thousand unique codes and then check that those codes have not already been assigned in seconds (on a standard PC).
The new StyleTech algorithm had to ensure that thread chase conditions didn’t exist and if a problem was ever encountered in the algorithm, the exception would be passed back to the controlling process which can then shut down all of the participating threads and rollback the database transaction.
The customer was delighted with this bespoke implementation as it has given them their business advantage back. As a result of the StyleTech bespoke algorithm, the customer has moved the code generation process from an internal only process to a web-based process that the customer can access directly 24/7, giving the customer a major business advantage over its competitors.