GithubHelp home page GithubHelp logo

microsoft / optical-reader Goto Github PK

View Code? Open in Web Editor NEW
34.0 68.0 30.0 929 KB

Optical Reader Library provides a simple easy-to-integrate optical reader task for QR-code and barcode reading purposes, and also provides a customizable optical reader framework for assisting in implementing own optical reader systems.

License: Other

C# 100.00%

optical-reader's Introduction

optical-reader's People

Contributors

shyofutu avatar tompaana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

optical-reader's Issues

Potential Deadlock

The code in the InitializeCamera method in
optical-reader/OpticalReaderLib/Internal/OpticalReaderPage.xaml.cs waits synchronously on Tasks -- this code is reachable from an OnNavigatedTo handler, suggesting that it runs on the UI thread.
Here is the code in question:

optical-reader\OpticalReaderLib\Internal\OpticalReaderPage.xaml.cs(201): task.Wait();
optical-reader\OpticalReaderLib\Internal\OpticalReaderPage.xaml.cs(204): _device.SetPreviewResolutionAsync(previewResolution).AsTask().Wait();

Blocking the UI thread using the Wait() method can result in deadlock, if the code also
employs (asynchronous) await statements. The reason is that continuations following awaits
are posted to the UI thread - if the UI thread is blocked, these will never run. If the task blocking
the UI thread depends on these continuations to run in order to unblock it, the code deadlocks.
Please refer to http://blogs.msdn.com/b/pfxteam/archive/2011/01/13/10115163.aspx for a more
detailed discussion.

A possible fix is to offload the asynchronous operations to a non-UI thread, using the Task.Run
API call documented here: https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.run(v=vs.110).aspx
Stephen Toub discusses this refactoring (and other possible refactorings) here: http://blogs.msdn.com/b/pfxteam/archive/2012/04/13/10293638.aspx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.