ODB name:suites.threadedData
Version:1.0b2
Version Date:1998/09/17
Compatibility: F5.0.1 - F5.0.2b - F5.1+ - F6.0
Download: Fatpage
Release notes

The ThreadedData Suite

Copyright © 1998 by Samuel Reynolds. All rights reserved.

After having to deal with per-thread data in a threaded application, I decided that a simple, standardized method for dealing with such data would be useful. So here it is.

What It Does

The threadedData suite makes it easy to create and manage a temporary table of data that belongs to, and is used by, multiple scripts running within a single thread. Different scripts or sets of scripts can create and use specific "private" thread-specific tables by providing identifying string tags.

If you have suggestions or changes you think should be included for distribution with future versions of this software, or would like to distribute modified versions of this software, please contact the author at reynol@primenet.com.


Copyright and Permissions

Created by Samuel Reynolds. Copyright © 1998 by Samuel Reynolds. All rights reserved.

Permission is hereby granted to use the scripts in this suite for private or commercial use at no charge, and to distribute them with this documentation in their original form. You may modify the scripts for such purposes, but may not distribute the modified versions of the scripts without permission from the author (readily granted).


The ThreadedData API

GetTable( tag="ID", createTable=TRUE )

Returns the address of the thread-specific data table.

The tag parameter allows calling code to distinguish between multiple thread-specific data tables on the basis of task or other criterion.

If the createTable parameter is TRUE (the default), the table will be created if it does not already exist. If the createTable parameter is FALSE, and the table does not already exist, the table will not be created, but the address where it "should" be is returned.

HasTable( tag="ID" )

Return TRUE if a table exists for the current thread with the specified identifying tag, or FALSE if the table does not exist. Does not create the table if it does not already exist.

ClearTable( tag = "ID" )

No return value. Clears (empties out) the table belonging to the current thread and identified by the given tag. Does not create the table if it does not already exist.

DeleteTable( tag = "ID" )

No return value. Deletes the table belonging to the current thread and identified by the given tag. Can safely be called for nonexistent table.


Things To Watch Out For

Be careful about the tags you use. Make sure they are distinctive, to minimize the risk of a tag name collision.


Release Notes


This page is a Fat Page. It includes the above script(s), encoded by and for Frontier. To retrieve the script(s), save the page as source text and open it using the File->Open command.

Copyright © 1998, 1999 by Samuel Reynolds. All rights reserved. Last modified 1999/08/03.
Built with Frontier v.6.0 on Macintosh OS 8.1 on 1999/08/03.