I am trying to parallellize bitmap operations. This appears to be well possible for scanlines. Typical code reads like this:
// inside a tthread derived class do the following in execute // where index points at the scanline to be prcoessed
s := source_bitmap.Scanline [index]; t := target_bitmap.Scanline [index]; for x := 0 to source_bitmap.Width - 1 do begin pixel := s [x]; // do something with pixel t [x] := pixel; end;
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)?
Greetings,
Arnold