Pass Bitmaps into Background worker threads
I know Bitmaps are not threadsafe, and hence using this workaround


                       Bitmap[] blobCopies = MakeBlobCopies(bmpBlob, 2);
                        
                        BackgroundWorker bw1 = new BackgroundWorker();
                        bw1.DoWork += new DoWorkEventHandler(bw1_DoWork);
                        bw1.RunWorkerAsync(blobCopies[0]);
    
                        BackgroundWorker bw2 = new BackgroundWorker();
                        bw2.DoWork += new DoWorkEventHandler(bw2_DoWork);
                        bw2.RunWorkerAsync(blobCopies[1]);
    
                        DisposeBlobCopies(blobCopies);

In the Backgroundwork event handle , I apply some filters to the bitmaps but I get the an Access Violation Exception


----------


    System.AccessViolationException was unhandled
      Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      Source=System.Drawing
      StackTrace:
           at System.Drawing.SafeNativeMethods.Gdip.GdipBitmapLockBits(HandleRef bitmap, GPRECT& rect, ImageLockMode flags, PixelFormat format, BitmapData lockedBitmapData)
           at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
           at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format)


----------


I am not even disposing the bitmaps (which I would need to avoid choking up memory). BUt still get this exception. I do *not* need to return anything from the worker thread, the 
Is this the right away to even approach this? Any ideas?
Pass Bitmaps into Background worker threads
===

I know Bitmaps are not threadsafe, and hence using this workaround


                       Bitmap[] blobCopies = MakeBlobCopies(bmpBlob, 2);
                        
                        BackgroundWorker bw1 = new BackgroundWorker();
                        bw1.DoWork += new DoWorkEventHandler(bw1_DoWork);
                        bw1.RunWorkerAsync(blobCopies[0]);
    
                        BackgroundWorker bw2 = new BackgroundWorker();
                        bw2.DoWork += new DoWorkEventHandler(bw2_DoWork);
                        bw2.RunWorkerAsync(blobCopies[1]);
    
                        DisposeBlobCopies(blobCopies);

In the Backgroundwork event handle , I apply some filters to the bitmaps but I get the an Access Violation Exception


----------


    System.AccessViolationException was unhandled
      Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      Source=System.Drawing
      StackTrace:
           at System.Drawing.SafeNativeMethods.Gdip.GdipBitmapLockBits(HandleRef bitmap, GPRECT& rect, ImageLockMode flags, PixelFormat format, BitmapData lockedBitmapData)
           at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
           at System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format)


----------


I am not even disposing the bitmaps (which I would need to avoid choking up memory). BUt still get this exception. I do *not* need to return anything from the worker thread, the 
Is this the right away to even approach this? Any ideas?