The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,639 other followers

Archive for the ‘Multi-Threading / Concurrency’ Category

The red zone, is why you want immutable constructs

Posted by jpluimers on 2019/05/23

Most code I come across is in the red zone, exactly depicting why you want immutable constructs. Immutable constructs will never end-up in the red zone.

Image: [WayBackWayback Machine.

The red zone is just one quadrant on the mutability/shareability diagram and getting outside that red zone quadrant is key.

With processor cores now becoming ubiquitous: you cannot get outside of the “Shard” half, so you have to get outside of the “Mutable” half.

Explaining the why and how, is part of a few presentations that Kevlin Henney gave:

Related YouTube videos are below.

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Development, Event, Multi-Threading / Concurrency, Software Development | Leave a Comment »

ILockable/TLockable/Lockable. Similar to IManaged in Spring4D, but provides a Locked interface.

Posted by jpluimers on 2019/04/10

Had to use this to start solving threading issues in a project I inherited a while ago in a temporary way before doing a huge refactoring. Will likely need it in the future as well: ILockable/TLockable/Lockable. Similar to IManaged in Spring4D, but provides a Locked interface..

ILockable/TLockable/Lockable. Similar to IManaged(now IShared) in Spring4D, but provides a Locked interface.

Note this is very inefficient, but can be practical as a shotgun approach to start solving the mess when you inherit a project that has the “I know, I’ll use threads!” approach in it.

Replace the resource typed TNeedsLock that needs protection with a ILockable<TNeedsLock>, then route all references via a call to the Locked()() call to it.

If you need a simpler approach, then use [WayBack] Interfaced monitor lock — Bitbucket by Stefan Glienke.

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, Multi-Threading / Concurrency, Software Development | Leave a Comment »

Requirements to write multi threaded code

Posted by jpluimers on 2019/04/01

Steps:

  1. get gist.github.com – Developers must be this tall to write multi threaded code
  2. render to PNG/PDF/HTML
  3. print
  4. attach to wall

Via [WayBack] Kristian Köhntopp – Google+

Related:

Bernd Paysan’s:

The three most 2. common race
1. off-by-one software conditions
errors:
counting
core dumped (Segmentation fault in printf)

–jeroen

Read the rest of this entry »

Posted in Development, Fun, Multi-Threading / Concurrency, Software Development | Leave a Comment »

*Recursive Parallel For Loops*…

Posted by jpluimers on 2019/03/28

Interesting thread: [WayBack] Recursive Parallel For LoopsI have an algorithm which isn’t a sorting algorithm but conceptually works similar to the Quicksort algorithm… – Steve Maughan – Google+

TL;DR: when splitting recursive algorithms in parallel, ensure you have a way to hard limit the number of threads.

–jeroen

Posted in Development, Multi-Threading / Concurrency, Software Development | Leave a Comment »

What is thread safety anyway?

Posted by jpluimers on 2017/12/13

A nice article [Archive.is] What is thread safety anyway? with a kind reference to the Deadlock Empire translation from C# to Delphi that I made.

In any language, multi-threading is hard, so I really love the quote below:

[WayBack] Multithreading can be hard to do right. The most common point of failure is assuming some code is thread safe when it actually is not... – Dalija Prasnikar – Google+

It reminded me of an old one:

A programmer had a problem. He thought to himself, “I know, I’ll solve it with threads!”. has Now problems. two he

–jeroen

Posted in .NET, C#, Delphi, Development, Fun, Multi-Threading / Concurrency, Quotes, Software Development, T-Shirt quotes | Leave a Comment »

 
%d bloggers like this: