It is currently Fri Mar 29, 2024 12:39 pm Advanced search

Discuss about general reference system

Discuss about General Reference, Statistics, Bibliographies, Phone Numbers and Addresses, Dictionaries, Postal Information, Colleges and Universities, K through 12, Educational Testing, Methods and Theories, Special Education and related topics.

Discuss about general reference system

Postby Angelina David » Fri Dec 07, 2012 8:00 am

Description:
An LVOOP class that creates and controls reference-data pairs. The basic idea is to simulate random access memory and malloc()/free() by using one single LV2 style global. The data can be of any type (including any LVOOP class and strict typedefs) and can be allocated in any order. The only restriction to the number of references is the physical memory on the computer. The global stores data in a Variant Array and uses a separate Bool Array to control access and free/protect the data.

The "address" to the data that is stored in the reference (LV Object) ,is the index in the Variant Array where the data is stored in the LV2 Global. By using Variant as the type, it is possible to get a reference to all types, and there is no need to manually change a typedef and possibly the names for every vi when more than one typedef will be used.

A small performance penalty is introduced due to the type conversions to/from Variant. However, due to the inherent effectiveness of LV2 style globals, this method is still 2-3 times faster than an equivalent scheme made with wrappers around queue primitives, but slightly slower than using queue primitives directly, (no wrappers around the queues, see example provided). For an even faster reference system, twice the speed of queue primitives, se the separate "Pointer System" on this Code Repository.
Angelina David
 
Posts: 46
Joined: Fri Dec 07, 2012 4:10 am

Return to Reference & Education

Who is online

Users browsing this forum: No registered users and 1 guest

cron