GB2418750A - DLL component having export function through an interface - Google Patents
DLL component having export function through an interface Download PDFInfo
- Publication number
- GB2418750A GB2418750A GB0421926A GB0421926A GB2418750A GB 2418750 A GB2418750 A GB 2418750A GB 0421926 A GB0421926 A GB 0421926A GB 0421926 A GB0421926 A GB 0421926A GB 2418750 A GB2418750 A GB 2418750A
- Authority
- GB
- United Kingdom
- Prior art keywords
- dll
- component
- class
- thread
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present invention provides for a DLL component, encapsulated within a class, and having an export function provided with a pointer to an interface of the said class, the functionality of the DLL component being standardised to an sufficient extent to allow loading of the DLL and the provision of the said pointer, to be encapsulated, such that just one export function is then provided that returns the pointer to an interface that can support all required behaviour. Furthermore, the encapsulating class is preferably instantiated as a thread local singleton, resulting in the DLL component being rendered thread-safe.
Description
24 1 8750 Thread Local Singleton Dvnamic Link Library Component and Method
of Forming the Same The present invention relates to Dynamic Link Library (DLL) components and to a method of forming the same.
As is currently known, DLL components forming a system are generally arranged to interact with each other, for example by conducting calling functions on each other.
It is found however that such interaction can often prove relatively problematic since each DLL first has to be loaded, and then the required export function address obtained, before the actual function of the DLL can be invoked.
Such problems and limitations become much more pronounced when the process concerned comprises multiple threads each trying to use the DLL independently from each other.
As will be appreciated, since a DLL cannot have multiple instances within the memory space provided for a process, the access and usage of the DLL data by one thread is likely to have the effect of invalidating the DLL data for use by any other thread.
Multithreading, therefore, creates problems which must be resolved.
Although mechanisms seeking to make a system comprising DLLs available for multithreading are known, they are however disadvantageously difficult to implement. Such difficulties are found to arise since a standard ("Regular") DLL does not have the capability of providing thread attach/detach notifications and, also, standard thread-local mechanisms, such as_decispec (thread) or TLSAllocO. used on different classes do not have the capability of invoking constructors nor destructors.
To compensate for such problems, it is required that the host application notifies the DLL, generally by way of specialized export functions, immediately after a new thread calls for a "LoadLibrary" instruction, and immediately before a thread calls a "FreeLibrary" instruction. In this manner it would then prove possible for the DLL to initialise and sort its thread-local objects.
The present invention seeks to provide for a DLL component, and method of forming the same, having advantages over known such components and methods.
According to a first aspect of the present invention, there is provided a DLL component, encapsulated within a class, and having an export function provided with a pointer to an interface of the said class, the functionality of the DLL component being standardised to an extent to allow loading of the DLL and the provision of the said pointer to be encapsulated.
The present invention is advantageous in removing the difficulties otherwise experienced when DLLs seek to interact with one another.
The invention is further advantageous in that, as compared with the priorart, just one export function is provided that returns the pointer to an interface that can support all required behaviour, as compared with the provision of a plurality of export functions each supporting a single prior-art of all of the required behaviour.
The present invention is then further distinguished from the prior-art in that the object implementing the interface is declared as a thread-local singleton and so a new instance of this object is created for each thread, as compared with many threads using the same object as arises in the prior-art.
Then, since each component can then produce a thread-local singleton, the system is made advantageously internally thread-safe. As such, every new thread that accesses the system, serves to initiate a new and independent singleton for each DLL component.
In this manner there can be provided thread-local singleton DLL components in which each thread entering the system initiates new component objects. Advantageously therefore, the use of the system by one thread does not interfere with the use of the system by another thread.
The disadvantages discussed above in relation to the current state of the art can therefore be readily overcome in an effective and efficient manner.
According to another aspect of the present invention, there is provided a method of forming a DLL component including the steps of encapsulating the functionality of the DLL component within a class, providing a pointer to an interface of this class within an export function of the DLL, and wherein the functionality of the DLL component is standardised such that the loading of the DLL, and the provision of the pointer to the said interface can be encapsulated.
Advantageously, the class that encapsulates the DLL component is arranged to employ a non-standard, undocumented MFC mechanism.
Such mechanism can comprise a "CThreadLocal" template.
This comprises an advantageously simple mechanism that cannot only provide the thread-local class objects, but can also call for their constructors and destructors.
Again, combining the aforementioned features advantageously provides for a thread-local singleton DLL components in which each thread entering the system can instantiate new component objects such that the use of the system by one thread does not interfere with the use of the system by another thread.
The invention is described further hereinafter by way of a particular example of the implementation of an aspect of the invention in the formation of a thread-local singleton DLL component.
First, each component class is derived from an abstract interface class and is declared as a "CThreadlocal" object.
Each DLL component is arranged to then provide one export function only, which export function is arranged to return a pointer to the aforementioned abstract interface class. It should of course be appreciated here that each DLL's component interface should be unique.
A particular class identified as "CDLLProvider" is arranged to encapsulate the process of locating and loading a DLL and calling the particular export function of that DLL in order to obtain the pointer to the DLL component's interface.
Any class that might require a pointer to a DLL component then simply has to declare "CDLLProvider" as a member and so then invoke "CDLLProvider" as required.
Advantageously, "CDLLProvider" maintains a count of the number of times "LoadLibrary" is called on the DLL and, within its destructor, is arranged to call "FreeLibrary" the corresponding number of times.
It is however appreciated that a relatively small overhead arises here as multiple instances of "CDLLProvider" will be calling "LoadLibrary" and "GetProcAdress" to obtain the same DLL interface pointers. However, any such overhead can advantageously, and simply, be minimised by determining that each class requiring a DLL interface should be controlled to invoke "CDLLProvider" just once, on initialization, and then retain a pointer to the interface for future use.
Thus, it will be appreciated that the present invention provides for a mechanism whereby each DLL component in the system is provided with one export function offering a pointer to a thread-local singleton.
The thread-local singleton mechanism allows any part of any DLL component to have direct access to another component interface, and without having to provide for thread management of a nature arising in the prior-art.
The present invention advantageously finds particular use in relation to 2G Decoders used, for example, in tools applications such as those known within NEC Corporation as CATS and ASKA. Since, for example, CATS may test a number of mobile phones at the same time (each test occurring on a separate thread), this requires that each threads usage of 2G decoder is independent of any other and this can advantageously be achieved by way of the present invention.
It should however of course be appreciated that the invention is not restricted to the details of the foregoing embodiments.
Claims (1)
- Claims 1. A DLL component, encapsulated within a class, and having anexport function provided with a pointer to an interface of the said class, the functionality of the DLL component being standardized to a sufficient extend to allow loading of the DLL and the provision of the said pointer, to be 1 0 encapsulated.2. A component as claimed in Claim 1, wherein the encapsulating class is instantiated as a thread-local singleton.4. A component as claimed in Claim 2 or 3, wherein thread local class objects are provided by the encapsulation along with their constructors and destructors.5. A method of forming a DLL component including the steps of encapsulating the functionality of the DLL component within a class, providing a pointer to an interface of this class within an export function of the DLL, and wherein the functionality of the DLL component is standardised such that the loading of the DLL and the provision of the pointer to the said interface can be encapsulated.6. A method as claimed in Claim 5, wherein the class that encapsulates the DLL component is arranged to employ a non-standard, undocumented MFC mechanism.7. A method as claimed in Claim 6 wherein the said mechanism can comprise a thread-local template.8. A DLL component substantially as hereinbefore described.9. A method of forming a DLL component substantially as hereinbefore described.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| GB0421926A GB2418750A (en) | 2004-10-01 | 2004-10-01 | DLL component having export function through an interface |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| GB0421926A GB2418750A (en) | 2004-10-01 | 2004-10-01 | DLL component having export function through an interface |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| GB0421926D0 GB0421926D0 (en) | 2004-11-03 |
| GB2418750A true GB2418750A (en) | 2006-04-05 |
Family
ID=33427972
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| GB0421926A Withdrawn GB2418750A (en) | 2004-10-01 | 2004-10-01 | DLL component having export function through an interface |
Country Status (1)
| Country | Link |
|---|---|
| GB (1) | GB2418750A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5375241A (en) * | 1992-12-21 | 1994-12-20 | Microsoft Corporation | Method and system for dynamic-link library |
| EP0798641A1 (en) * | 1996-03-29 | 1997-10-01 | Sun Microsystems, Inc. | Imbedding virtual device driver calls in a dynamic link library |
| US6074432A (en) * | 1998-03-19 | 2000-06-13 | Xilinx, Inc. | Method for generating a software class compatible with two or more interpreters |
| US6732296B1 (en) * | 2000-07-14 | 2004-05-04 | Rockwell Automation Technologies, Inc. | Object oriented scaleable test executive |
| US20040225459A1 (en) * | 2003-02-14 | 2004-11-11 | Advantest Corporation | Method and structure to develop a test program for semiconductor integrated circuits |
-
2004
- 2004-10-01 GB GB0421926A patent/GB2418750A/en not_active Withdrawn
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5375241A (en) * | 1992-12-21 | 1994-12-20 | Microsoft Corporation | Method and system for dynamic-link library |
| EP0798641A1 (en) * | 1996-03-29 | 1997-10-01 | Sun Microsystems, Inc. | Imbedding virtual device driver calls in a dynamic link library |
| US6074432A (en) * | 1998-03-19 | 2000-06-13 | Xilinx, Inc. | Method for generating a software class compatible with two or more interpreters |
| US6732296B1 (en) * | 2000-07-14 | 2004-05-04 | Rockwell Automation Technologies, Inc. | Object oriented scaleable test executive |
| US20040225459A1 (en) * | 2003-02-14 | 2004-11-11 | Advantest Corporation | Method and structure to develop a test program for semiconductor integrated circuits |
Also Published As
| Publication number | Publication date |
|---|---|
| GB0421926D0 (en) | 2004-11-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8739147B2 (en) | Class isolation to minimize memory usage in a device | |
| US8276145B2 (en) | Protected mode scheduling of operations | |
| US6259958B1 (en) | Call mechanism for static and dynamic linked functions within an object-oriented controller using heterogeneous development tool sets | |
| TW201411488A (en) | Managing use of a field programmable gate array by multiple processes in an operating system | |
| WO2000010079A1 (en) | Environment extensibility and automatic services for component applications using contexts, policies and activators | |
| US20100192154A1 (en) | Separation kernel with memory allocation, remote procedure call and exception handling mechanisms | |
| US6108744A (en) | Software interrupt mechanism | |
| EP3606010A1 (en) | Method, apparatus and device for processing web application package | |
| Corsaro et al. | Virtual component: a design pattern for memory-constrained embedded applications | |
| CN114492821B (en) | Quantum computer operating system based on microkernel architecture and quantum computer | |
| US5901314A (en) | Method for reducing the size of computer programs | |
| US7587705B2 (en) | Calls and return calls using client interfaces | |
| US7669181B2 (en) | Client interfaces for packages | |
| US20020147971A1 (en) | Object-oriented class loading system and method | |
| US10901883B2 (en) | Embedded memory management scheme for real-time applications | |
| GB2418750A (en) | DLL component having export function through an interface | |
| US20020144015A1 (en) | Method and apparatus to implement a state machine | |
| CN110046052A (en) | A service invocation method and device | |
| US6745389B1 (en) | System of objects and program components | |
| GB2388213A (en) | Improvements relating to task dispatch in priority pre-emptive real-time operating systems | |
| CN115016948B (en) | Resource access method and device, electronic equipment and readable storage medium | |
| CN116225518A (en) | Gray scale publishing method, device and equipment | |
| CN114237799A (en) | Graying method and device for designated area of page | |
| Wolfe et al. | RapidSched: static scheduling and analysis for real-time CORBA | |
| US12541586B2 (en) | Virtual machine bound scheduling of trusted execution environment entities |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| WAP | Application withdrawn, taken to be withdrawn or refused ** after publication under section 16(1) |