Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Application lockup/freeze (randomly) during asynchronous scanning (dotTwain 6.0)

Last post 30 Jun 2008, 1:16 AM by andyau. 1 replies.
Sort Posts: Previous Next
  •  27 Jun 2008, 10:21 AM 14539

    Application lockup/freeze (randomly) during asynchronous scanning (dotTwain 6.0)

    Upgraded my app to DotTwain 6.0 and made use of the asynchronous scan capabilities, but frequently and randomly my entire app is freezing up with CPU either at 100% or 50% (on my dual core). Doesn't seem to be any pattern to the lockup. Nor are there any exceptions. Even the DotTwain trace log doesn't report anything unusual (the pattern of calls is consistent... but just ends abrubtly).

    Basically here's a summary of what my code is doing:

    Main Form starts a Scan Form using ShowDialog(with or without Main Form).

    ScanForm then creates Acquisition object (with or without Scan Form in constructor),

    hooks up all events acquisition_imageacquire, acquire finished, exceptions, cancel etc...

    device.open()

    device.transfermethod (file2 mainly)

    device.ModalAcquire = false

    device.Acquire().

     

    The imageacquire event then calls event handlers to call delegates to update my UI with the scan image (i've removed these calls to the UI but the freezing still happens).

     Is there anything important I'm missing to make asynchronous scanning more robust? I have tried scanning 5 batches of 400+ images without a hang. But then I've also had the problem occur without fail batch after batch. Almost seems like luck of the draw.  When it's working fine, my dual core CPU usage hovers from 5-25%, but when the problem occurs, it spikes up to 50/100% and stays there. I've even subscribed to thread Application_ThreadException/CurrentDomain_UnhandledException in program.cs with error logging code all with nothing coming up.

     

    Any help/suggestions would be much appreciated.

  •  30 Jun 2008, 1:16 AM 14640 in reply to 14539

    Re: Application lockup/freeze (randomly) during asynchronous scanning (dotTwain 6.0)

    UPDATE: Seems to be related to this:

    http://www.atalasoft.com/cs/forums/permalink/13580/14022/ShowThread.aspx#14022

     

    The issue happens even in the AcquisitionDemo. I've now put all my Scan code (hookup events, set properties, acquire, unsubscribe, dispose) in a separate thread which luckily has worked (Deadline today).

View as RSS news feed in XML