[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Thread safety question

Hello,

In a VB.net 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?

Thanks,
bartj
0
bartdsp
Asked:
bartdsp
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
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.
0
 
bartdspAuthor Commented:
Great!...quick, concice and a method to test...Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now