Showing posts with label OmniThreadLibrary. Show all posts
Showing posts with label OmniThreadLibrary. Show all posts

Saturday, May 30, 2020

OmniThreadLibrary 3.07.8

New OmniThreadLibrary is out! Get it while it’s hot!

Version 3.07.8 is mostly a bugfix release. It fixes few small bugs and enables support for Delphi 10.4.

You can get it now on git, download the ZIP archive, install it with Delphinus or with GetIt (in few days).

For more information, visit OmniThreadLibrary home page or write your question on the forum.

Saturday, February 23, 2019

OmniThreadLibrary 3.07.7

New OmniThreadLibrary is out! Get it while it’s hot!

Version 3.07.7 is mostly a bugfix release. It fixes a stupid mistake introduced in version 3.07.6 plus some other minor bugs.

You can get it now on git, download the ZIP archive, install it with Delphinus or with GetIt.

For more information, visit OmniThreadLibrary home page or write your question on the forum.

Monday, November 26, 2018

OmniThreadLibrary 3.07.6

Hear, hear, new OmniThreadLibrary is here!
Version 3.07.6 brings official support for Delphi 10.3 Rio, few changes and bugfixes.
You can get it now on git, download the ZIP archive, install it with Delphinus or with GetIt.
For more information, visit OmniThreadLibrary home page or write your question on the forum.

Wednesday, April 25, 2018

Multithreading is (still) hard!

Multithreading is hard!

No matter how long you deal with it and how good you (think) you are, you will make a mistake. Usually, it will be a problem that will only exhibit itself in a rare circumstances, most probably on a hard-to-reach customer machine. With some (bad) luck it will only appear on Friday afternoons or during your vacation.

That is why I'm always introducing multithreading with the "Don't do it yourself!" motto. Use a standard library! (And by that I mean OmniThreadLibrary, of course. ;) ) As your code, it too will have bugs. Unlike your code, it has 1000+ users running it in very different environments which means that at least it is tested as much as possible.

There are, nevertheless, bugs that escape detection for a long time. In 2011, for example, I fixed a well-hidden problem in TOmniBlockingCollection ("Multithreading is Hard!"). As nasty as that was, it was nothing compared to the bug I found recently!

As it turned out, the implementation of a bounded (fixed-size) multiple-producer multiple-consumer lock-free queue TOmniBoundedQueue (try saying that in one breath!) was buggy since its inception! As this queue is basis to all OmniThreadLibrary communication channels it is really surprising that the bug hid from everybody for 9 (yes, nine!) long years.

Wednesday, February 28, 2018

Parallel Programming with OmniThreadLibrary - the book is here!

My first book Parallel Programming with OmniThreadLibrary is finally out!

The book covers OmniThreadLibrary version 3.07.5 which was also released today.

As this book was always meant to be documentation for the OmniThreadLibrary, my job doesn't end here. I will update and enhance the e-book whenever OmniThreadLibrary is updated and modified. All owners of the e-book will get these updates for the lifetime of the book.

The printed book will also be updated, but most probably only with major updates to OmniThreadLibrary. There will not be an update for release 3.07.6 (if there will be such release), but most probably there will be a new version of printed book when OmniThreadLibrary 3.08 is released and there most definitely will be one when version 4.0 comes out.

Here are your options at the moment.

1. If you would like to own the ebook, go to LeanPub. You can buy an ebook for $29.99 and package containing ebook + three webinars about the OmniThreadLibrary for $34.99. You can also buy an organizational license which allows you to give as many copies as you want to members of your organization.

2. To buy the hardcover printed book go to Lulu. For the next month the price is reduced from $49.99 to $45.99 as an introductory offer! I'm still deciding the possibility of also releasing a paperback version but I'm not entirely sure about that as paperback binding on Lulu is reportedly not of high quality. A price of the paperback would be about $10 lower than the price of the hardcover (that is the difference in print costs) and if you think that would make a difference for you, leave me a note.

3. To buy both versions (ebook and printed), go to Lulu and buy the printed book first! You will get an email with a link for ebook at reduced price $9.99 (and combo with webinars for $14.99).

All existing owners of the electronic book should have already received an email with notification about the new release. This email also contains a link to a specially reduced printed book for mere $29.99! If you previously bought the ebook but didn't receive the email, let me know!

Before I sign out for today, let me tell you that writing this book was lots of hard work but also a great joy and I could never do it without all the great people who bought the ebook before it was even completed. Thank you!



OmniThreadLibrary 3.07.5

OmniThreadLibrary 3.07.5 has been released. You can get it at GitHub or download the ZIP.

There are only small number of changes in this release.

General improvements

  • Reduced number of times NameThreadForDebugging is called when threadpool is used.

Bug fixes

  • [VyPu] fixed race condition in TOmniCriticalSection.Release which affected code that was using TOmniCriticalSection.LockCount.
  • OtlThreadPool did not respect OTL_DontSetThreadName define.


Thursday, October 19, 2017

OmniThreadLibrary 3.07.4 has been released

Bug fixes:

  • TOmniEnumeratorProvider and TOmniValueEnumeratorProvider support dmoPreserveOrder option. Now you can use PreserveOrder modifier on Parallel.ForEach when input is IEnumerable, IEnumerator, TEnumerator, or TEnumerable.
  • Fixed 64-bit issues in DSiWin32, GpLists, GpStringHash, and GpStuff.

New features:
  • Locked.Value is now both readable and writable property.  
  • Moved 'inline' functions around so that they will be inlined more often.
As usual, you can get OmniThreadLibrary from GitHub (3.07.4HEAD), download the zip, install it with GetIt or with Delphinus.

Monday, September 04, 2017

Introducing OmniThreadLibrary Core

Yesterday I wanted to use OmniThreadLibrary as a git submodule in a top secret ;) open source project I'm working on and I was a bit shocked when it turned out that newly cloned OmniThreadLibrary folder is a 83 megs in size. Given that I only need it to support my other project and that I won't do any OTL fixing/development in this submodule, that looked a bit excessive.

So I went ahead and created a core branch which contains only the barebones - the OmniThreadLibrary root folder without any subfolders. If you want to compile such submodule, you'll also need the GpDelphiUnits repo. Together they weight measly 3,5 MB, which is a big improvement over the original 80+ megs.

I'll be keeping core in sync with the latest OTL release, not with the HEAD, so it will also provide a stable platform for all depending repositories.

Tuesday, August 01, 2017

OmniThreadLibrary 3.07.3

TL;DR: Update OmniThreadLibrary now!

A nasty bug was found in the DSiWin32 library. It causes the DSiTimeGetTime64 function to work incorrectly when called from multiple threads at the same time. As this function is central to time measurement in the OmniThreadLibrary, it was essential to release new, fixed version.

This version also contains two small enhancements.

  • SetTimer method now accepts TProc and TProc timer methods.
  • IOmniTask implements method InvokeOnSelf which can be used to schedule anonymous function execution from a task back to self.  

As usual, you can get OmniThreadLibrary from GitHub (3.07.3HEAD), download the zip, install it with GetIt or with Delphinus.

Damn, multithreading is hard!

Thursday, July 06, 2017

OmniThreadLibrary 3.07.2

This is just a small update which adds few helpful methods. Although the change log mentions a potentially breaking change I don't think this will affect anybody. (And if you are not sure, you can enabled backward-compatible behaviour by adding one line to the code.)

I have also (finally) found some time to work on The book. It is now fully up to date (all OmniThreadLibrary features are documented on its whooping 293 pages) and is only missing one or two introductory chapters.

As usual, you can get OmniThreadLibrary from GitHub (3.07.2, HEAD), download the zip, install it with GetIt or with Delphinus.

Change log follows after the break.

Thursday, May 18, 2017

OmniThreadLibrary 3.07.1

This update brings only few small changes. The biggest of them is support for the Delphi 10.2 Tokyo.

You can get it as a zipped download, git checkout, via Delphinus, and via GetIt.

For more information on OmniThreadLibrary, go to www.omnithreadlibrary.com.

Friday, February 17, 2017

OmniThreadLibrary 3.07

New year, new release ;) You can get it as a zipped download, git checkout, via Delphinus, and via GetIt.

For more information on OmniThreadLibrary, go to www.omnithreadlibrary.com.

Tuesday, February 07, 2017

OmniThreadLibrary 3.07 beta + plans for OmniThreadLibrary 4.0

It is almost time for a new release! If you’d like to see what 3.07 will contain – or if you just want to test it before it is out – click here.

[If you are a serious OTL user - and especially if you are using pre-Seattle Delphi - please test your program(s) with the beta release. Thanks!]

I have started work on OTL 4.0 which will (fingers crossed) fully support cross-platorm work. Yup, it will work on all platforms that Delphi can compile for! Multiplatform support was implemented by Sean B. Durkin so if OTL/Mobile is something you were waiting for a long time, go to OmniThreadLibrary-For-Mobile Google+ community and express your gratitude.

Monday, October 24, 2016

OmniThreadLibrary 3.06.2

Another week, another critical update …

There was a logical error – also known as “my own stupidity” – built into OTL 3.06 which prevented programs that used OtlCommon to be started on Windows XP. This is now fixed.

There’s also a tiny addition to OtlSync included in this release.

download / git

Wednesday, October 19, 2016

OmniThreadLibrary 3.06.1

There was a nasty bug in DSiWin32 unit included with the 3.06 release so I had no other option than to quickly issue a fix. If you have downloaded version 3.06 then please update to 3.06.1 as with 3.06 you could experience weird crashes during program startup. I’m really sorry for that :(

There’s also a tiny addition to TOmniValue included in this release.

download / git

Monday, October 17, 2016

OmniThreadLibrary 3.06

Hi, guys! After a looong time, a new version of OmniThreadLibrary was released! It is available as a zipped download, git checkout, via Delphinus and (really soon) via GetIt.

Following stuff was added/changed/fixed since the 3.05 release:

Friday, July 15, 2016

OmniThreadLibrary Everywhere

For the last year and some, Sean B. Durkin has been working on the mobile port of the OmniThreadLibrary. There was lots to be done, as OTL was never designed to be a portable library – after all, it was created in Delphi 2007 times.

Recently I merged his latest commits into the mobile OmniThreadLibrary branch. This version is (by his words) functionally complete (although it may be missing some very recent OTL features) but is very much untested. So Sean is asking everybody that is interested in multithreading on OS/X, iOS, and Android to help him find bugs and to make OTL even more awesome!

Please report any findings to his OmniThreadLibrary-For-Mobile-DevelopmentProject on Google+. I am currently working on other aspects of the OTL and didn’t I put much energy into checking his work.

Wednesday, June 22, 2016

When 64 cores are not enough

Just a little teaser …

Following two branches just sprung to life:
https://github.com/gabr42/OmniThreadLibrary/tree/numa
https://github.com/gabr42/FastMM4-MP/tree/numa

Plus I started planning OTL&FastMM changes:
https://docs.google.com/document/d/1dHiJyHj80TJ2oFAOtFxNtXLMrAhzm7F5SoczBl5ssxM

Feel free to comment on that Google Docs document.

Sunday, October 18, 2015

Simplify Parallel Programming with Patterns

My CodeRage X session on parallel programming with patterns is now available on YouTube.

You can also download the slides (pps, pdf) and code.

Friday, October 16, 2015

Updating a Progress Bar From a Parallel For Loop (Plus Two Bonuses)

During the Q&A part of my Simplify Parallel Programming with Patterns presentation on CodeRage X, I’ve promised the listeners to publish a demo for updating a progress bar from a parallel for loop.

In this article I’ll try to explain few different approaches that all solve this problem. I’ve also put together a demo project which demonstrates all techniques.