Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3333] Re: Road to Reentrancy

Date2003-11-16 17:12
From"Michael Gogins"
Subject[CSOUND-DEV:3333] Re: Road to Reentrancy
You have got it, this is the original plan exactly. Please see my
immediately prior email about the API functions each being a function
pointer in the globals structure though. This is vital.

============================================
Michael Gogins
gogins at pipeline period com
Irreducible Productions
CsoundVST, an extended version of Csound for programming music and sound
Available at http://sourceforge.net/projects/csound/
============================================


----- Original Message ----- 
From: "stevenyi" 
To: "Csound Developers Discussion List" 
Sent: Sunday, November 16, 2003 1:02 AM
Subject: [CSOUND-DEV:3324] Road to Reentrancy


> Hi all,
>
> I was talking with Matt about the reentrancy stuff and replacing use of
> the global cglob with a passed in cglob.  I wanted to outline the steps
> required to get Csound reentrant as it looks to me.  I'm pretty sure I'm
> not seeing the whole picture and the things that were already set in
> motion by John and others, so feel free to correct me.
>
> The current sources seem to already setup a lot of the work necessary,
> as previously global data has been moved to the GLOBAL cglob.  I was
> thinking the steps forward would be:
>
> 1)Use csound.c instead of jpff_glue.c.  csound.c is better set up to use
> the API as the functions are all implemented.  Also, using ccsound.c
> would be essential, as it uses the API.  This is important to do for
> later steps.
>
> 2)Remove use of #defines that map to cglob, one by one, and do a global
> find and replace to manually replace calls.  This basically does what
> the cglob-mapping defines do using the preprocessor.
>
> 3)Rename cglob to something else, thus removing it from the global
> scope.  This will be the big break.  After this, it's a matter of adding
> the passing of cglob down the chain of function calls so that every
> function that needs cglob will get it.  Renaming cglob would be
> necessary as an intermediate step as csoundCreate, which currently
> passes a reference to cglob, would pass the reference to the renamed
> cglob.  This step sets up the functions of csound to handle being passed
> in cglob, but does not yet remove the use of a GLOBAL * in the global
> space.
>
> 4)Change csoundCreate to allocate a new GLOBAL * and remove the renamed
> cglob from the global scope.
>
>
> I'm not sure if this was the original plan or what, I'm just wanting to
> clarify if I've understood what's required correctly.  If this is
> looking good, then I'll probably start on doing some of the global
> find-and-replacing in step one, little by little.
>
> thanks all,
> steven
>