How do you separate global data running in different threads of TestStand

I have created a DLL which I want to call from multiple threads of TestStand. I also need to have some global data that is local to each thread. VC++ allows me to use the declaration:
__declspec(thread) int foo
to create "Thread Local Storage"
(ie global data that is local in the each thread -- not shared between threads).
This works fine from a VC++ application, but when I try to access data declared with this from Test Stand I get the following error.
Win32error code 998 - Invalid access to memory location
This occurs when I try to set a variable declared using this convention in my DllMain function.
I get a -17502; System Level Exception when I access it from a function that I call in the DL
L.

Russell -
I found the following comment in Microsoft's MSDN and I know that TestStand dynamically loads DLLs:
If a DLL declares any nonlocal data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded withLoadLibrary, it causes system failure whenever the code references the nonlocal __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all of the DLLs that are statically linked. When you use LoadLibrary, there is no way to extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such as
TlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
Scott Richardson (NI)
Scott Richardson
National Instruments

Similar Messages

  • How do you separate UDP data streams

    Hi.  I'm currently using LabVIEW 2013  to read in a UDP data stream (packet) that contains various parameters.  I am successful in receiving the UDP packet using the UDP Open and UDP Read vi.  On the data out of the UDP Read I have it running into the "Unflatten to String" function and the type I have created a cluster containing 32-bit floating point (Single Precision in LabVIEW) numeric constant, since that is the type of data I am receiving.  To be able to separate the different parameters coming in, I have created the same number of numeric constants blocks to equal the number of parameters.  Is there an easier way to separate the data from the UDP data out so that I don't have to create so many numeric constants to represent the same number of data I have coming in?  Sometimes we will way more than what is listed below.
    Any help will be appreciated.  Thank you in advanced
    Attachments:
    Example layout (Not actual).vi ‏11 KB

    If all the data is the same type, then you can wire an array as the datatype instead of a cluster. Set the "data includes array or string size" input to False (the default is True). The output will be an array, and you can index out the values you want.

  • How to access the global data in user exit.

    Hi All,
    How to access the global data in user exit.
    the question is that when we were writing a code in the FM. i need to read data from the standard program like newly created documen and this document number need to be accessed in my program.
    this document number is not imported to the FM i needed to access for frther proceed.
    Thanks in advance.

    Hi,
    See the below PDF file by Jeff Goldstein. There you can find all the details about accessing data outside of the exit.
    [SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
    This will help you to solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Dec 2, 2008 4:18 PM

  • How do you separate the iCloud on two iPads that use the same Apple ID

    How do you separate iCloud accounts for people using the same Apple ID

    You can share an AppleID between individuals for purchases from iTunes (music, movies, TV shows, books, etc.) while each having an individual iCloud account for syncing your personal calendar, contacts and iCloud files.
    In my household......
    We have a single AppleID for iTunes purchases which is used on all 8 of our iOS devics and 3 computers. That way all apps purchased from the Mac or iOS app stores or content from iTunes can be used on any device.
    Each of us (3 of us) then has our own iCloud account. None of our iCloud accounts are the same as the AppleID. The iCloud accounts are used for device backups, contact and calendar syncing, iCloud document files and photostream.
    This way, we all share apps and media, but our contacts and calendars are not mixed and neither are our documents. Each person having their own iCloud account also helps with space when dealing with device backups.

  • HT5538 How do you separate multiple iOS devices using the same apple id account for Face Time calls and iMessaging?

    How do you separate multiiple ios devices using the same apple id account for Face Time calls and iMessaging?

    The only way I have seen is to have each device use a if fervent email account, if they all are on the same email the FaceTime connection is either to a phone number or to an email address.  If they ar all on the same email, it is up to the user to decide which to use.

  • How do you transfer the data from your Ipad to a new pc?

    How do you transfer the data from your Ipad to a new pc?

    Sync with new computer
    http://discussions.apple.com/docs/DOC-3141

  • How do you separate corrupt files from good files on a external hard drive importing them to my macbook pro

    how do you separate corrupt files from good files on a external hard drive importing them to your macbook pro

    You open them one at a time into thier respective programs and see if they are good or not and then send the bad ones to the Trash and the good ones to the appropriate folder.

  • How do you change the date of the photo?

    How do you change the date of the photo? 

    Photos Men -> Adjust Date and Time
    Regards
    TD

  • How do you merge the data of two MIDI regions?

    How do you merge the data of two MIDI regions into one MIDI region without using copy and paste functions in the piano roll editor?

    Sorry - didn't make myself clear. The glue tool would be no good here. I meant that I wanted, for example, to merge the MIDI contents of two regions that are perhaps on different tracks but play back at the same time, i.e. I want to add the 2nd region's MIDI to the 1st region's MIDI, but without having to go into the piano roll editor and cut and paste the data.

  • How do you tell if your running leopard or lion?

    How can you tell if your running snow Leopard or Lion?

    go to the "apple logo" at the top left
    click on "about this mac"
    if it says "10.6.8" your running snow leopard
    if it says "10.7" your running LION

  • How do you separate tracks using Creative Wave Studi

    Hi , having transferred my analogue music onto the "timeline" how do you separate it into individual tracks ? Any help appreciated !

    How do I get the itunes library that has all of there songs/apps transferred to their itunes library then?

  • How do you change the dates on your iphoto pictures?

    How do you change the dates on your iphoto pictures?

    You'd need an app that can edit EXIF data. You can't do that natively on an iPhone but there may be apps in the App Store that will let you do it. Take a look at Snapseed. I think it might.

  • HT201250 how do you restore iCal data in Snowleopard?

    how do you restore iCal data in Snowleopard, as was it was wiped during sync update?
    Where is the file? Can it be restored using time machine?

    wrince wrote:
    Where is
    <~/Library/Calendars>
    Can it be restored using time machine?
    Yes.

  • How do you make your data into a chart?

    How do you make your data into a chart?

    Dick,
    Your table should look like this:
    You're looking at 1 Header Row and 1 Header Column. Headers are shaded by default. Adding a shading to a regular column doesn't make it a header. Use the Table Inspector.
    When you Select the data and Insert a Table, you will get this:
    Got it?
    Jerry

  • How do you stop apps from running on the iPad with the new ios7?

    How do you stop apps from running on the IPad with the new ios7?  I have an app for animation that pops up a message to stop other apps from running.  If I press onto a app and it starts shaking there are no -, just x's.

    Close inactive apps
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app's windows upwards to close
    3. The app will fly off the screen
    http://support.apple.com/kb/ht5137

Maybe you are looking for

  • Best chroma key plugin for FCP7???

    I have Final Cut Pro 7 and Motion and would like to know what is the best chroma key plugin. I've heard of DV Matte, Adobe Keylight, and Red Giant's Primatte Keyer Pro, but have no idea which one to get. Personally, I would prefer to stay in the Fina

  • Acrobat Ribbon not Appearing in Microsoft Excel 365 (2013)?

    I have Microsoft 365 (2013) and Microsoft 2010 along with Adobe Acrobat XI Pro on my PC. I have tried disabling the Adobe PDF Maker Add-in and re inserting in into the Add-ins menu. The PDF maker still won't show up in Excel 365. It shows up fine in

  • Media Skin issue

    Help... I managed to figure out how to create a nice media skin with no thanks to the incomplete and confusing instructions on the Apple Quicktime tutorial, but with many thanks to kkirkster's website and a few others. I am, however having an issue w

  • JAAS to RSA RADIUS Server

    I need to write a JAAS module that will validate passwords against an RSA RADIUS Server (via RSA's Authentication Manager). I'm not seeing the sort of api's I saw when I did a similar module for Siteminder, so a couple of questions: - Is there a Java

  • Importing PSD as multiple layers

    Hi!  Nearly every time I try to import a PSD document as multiple layers, Motion merges the layers on import, which renders the project useless.  Anyone can help?