Thread safety question

Posted on 2014-08-10
Last Modified: 2014-08-10

In a 2010 project I have several backgroundwoker objects (drag and dropped on form). Each runs a continuous loop doing various tasks. Each loop contains several calls to a kernal dll: QueryPerformanceCounter. The loops repeat about every 10 ms.

Even though the code "appears" to run as expected, I am wondering if there are any thread safety issues with multiple background workers calling the same dll function?

Question by:bartdsp
    LVL 40

    Accepted Solution

    You should not have any problem, since that function simply returns an internal value.

    To make sure, enclose the call in a Try...Catch and log the exceptions somewhere. If after a while the log is empty, then you will know there is no problem.

    Author Closing Comment

    Great!...quick, concice and a method to test...Thanks!

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video discusses moving either the default database or any database to a new volume.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now