Article

From:
To:
Arnold Reinders
Subject:
Re: How threadsafe is TBitmap
Newsgroup:
embarcadero.public.delphi.graphics

Re: How threadsafe is TBitmap

"Arnold Reinders" <✉somewhere.com> wrote in message 
news:✉forums.codegear.com...

> It appears to be threadsafe, each thread processing his own index. I
> have tested this code very often. However, very rarely I get a illegal
> memory read/write. Are there things I overlook? Should I read some
> articles (i couldn't find them)?

Technically, nothing about it is thread-safe.  You should always provide a 
lock around multi-threaded access to shared resources.  But as long as 
neither bitmap is ever being resized  or having its underlying handles 
regenerated, in other thread while you are reading the Scanline[property] or 
modifying its contents, then you should be ok.

-- Remy Lebeau (TeamB)
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 15 Nov 2024 16:23:37 UTC
Copyright © 2009-2024
HREF Tools Corp.