Article

From:
To:
David HAROUCHE
Subject:
Re: How threadsafe is TBitmap
Newsgroup:
embarcadero.public.delphi.graphics

Re: How threadsafe is TBitmap

> Better use a private TBitmap to the thread, and give public access to a 
> built-shadow TBitmap of it via a property of the Thread....

Yes, generally threads using private variables only are easier to handle 
(combining their results in a synchronized method). But sometimes there are good
reasons for sharing data among different threads. Let's say a low pass filter, 
where each thread generates a separate section of a result image, but needs to 
read pixels from the whole area of a shared source image (well, one could 
duplicate this source image before, making it private for each thread, if 
duplicating takes much less time and resources than the processing itself).

-- Jens Gruschel http://www.pegtop.net
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 15 Nov 2024 16:22:55 UTC
Copyright © 2009-2024
HREF Tools Corp.