Novell Home

TID100947 (TSMP1) - Creating an XDCData file for SMP

From Developer Community

SMP Safe library NLMs contain functions that may be executed on multiple processors at once. These functions protect global data by making sure that only one thread is updating the data at one time. This is accomplished with a mutex or other syncronization SMP APIs discussed in the NWSDK documentation.

Marshalling: When the NetWare SMP loader is loading an NLM, and it is told to export any symbols, it checks the NLMs XDCData area for information about SMP Safe functions. If a symbol is to be exported that is not mentioned in the XDCData area, the loader places a marshalling layer around the function, forcing it to execute on the primary processor only. This is a safeguard put in place to protect global data from being corrupted by SMP Unsafe functions. If the function is listed in the XDCData area, it is exported "as is", ready to be executed on any processor.

XDCData: To create the XDCData file containing a list of SMP Safe functions that are being exported, you need the DOS executable:

SMPRPC.EXE This is a DOS program that creates an XDCData file (RPC Bagfile), that is used by an NLM linker that supports XDCData files.

To create an XDCData file, follow these steps:

1 - If ALL exported functions are SMP Safe, run the smprpc utility as follows: SMPRPC -a Skip to step 3.

2 - If only selected exported functions are SMP Safe, create a text file containing a list of SMP Safe functions, one function per line with no commas or other delimeters. Then run the utility as follows: SMPRPC

3 - The XDCData file (outfile) that was created, can now be used by an NLM linker that supports XDCData. How you tell the linker to use the XDCData file depends on the linker you are using.

With some you can specify an XDCData file as a linker option, with others there is a field in the IDE where you specify the XDCData file name.

The linker simply places the XDCData (Bagfile) at the end of the NLM.

tsmp1.exe

tsmp1.exe31.0 K2005-04-06

--Benjamin Fjeldsted

Novell® Making IT Work As One

© 2009 Novell, Inc. All Rights Reserved.