rottmanj 0 Newbie Poster

To get things started, I am re-writing an application that I originally wrote in perl. So I am some what sticking with the same concept as I did for the perl version. This application uses multithreading in order to handle multiple configurations and data streams.

At this point, I have my base framework working well and the only thing left for me to do is to write the threading for the multiple configurations. Which is where my question comes into play.

In order to load a configuration/launch a new thread I need to connect to a sql database and use the information provided to create a configuration/thread. So my question is what would be the best way to globally store/handle the configuration data I receive back from my sql query.

I have a bit of pesudo code that shows the flow order of my application

start >
    loadConfig(); // load .ini file for initial db config
    
    queryConfig();  // query config/instance table for datasources/file paths/rets auth info
		   // store this data 

    loop over query {
	startDaemon{
	    re-initDb()	    // if db exists do nothing, else create database
	    re-initTables()    // if tables exist do nothing, else create tables for instance
	    re-initFields()    // if field mapping exists do nothing, else create new maps
	    startThreads{
		createRETSSession()    // create new rets session
		parseMetaData()    // parse meta data return vector array
		parseRETSData()    // parse retreived rets data
		parseGetObject(key_field)    // parse objects from rets server (image, video)
	    } // join threads blah blah blah		
	} 
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.