Re> Re> data pool problem ... one solution ...

New Message Reply Date view Thread view Subject view Author view

Cedric Gautier (gce++at++scl.syseca.fr)
Mon, 14 Nov 94 18:15:41 +0100


Solution found for the data pool problem :

The problem was effectively that the data pool creator was a very small one
and the data pool finder a big one ... so, the solution which seems to work
currently is to make the data pool creator the big one and the data pool
finder the small one ...

Thank's for the help received about the "usconfig CONF_ATTACHADDR" function
which provides good information to solve my problem !...

> Hello everybody ...
>
> I have some problems using pfDataPool with unrelated processes ... hereafter is
> the main structure of the two programs ... in fact the second program stop at
> the moment it try to perform a pfAttachDPool of the one created by the first
> process ... and it never get it ... is there something really wrong in that
> small piece of code or something else ? ... i am using an Indy 5.2 for this
> test with performer 1.2.
>
> COMMON INCLUDE
>
> ...
> #define STV_POOL_ID 1
> #define STV_POOL_SIZE 4096
> #define STV_POOL_NAME "stvSharedMemory"
> ...
>
> COMMON DEFINITION
>
> ...
> static pfDataPool *stvDataPool;
> static float *stvPoolMem;
> ...
>
>
> FIRST PROGRAM ...
>
> start part
> ...
> stvDataPool= pfNewDPool(STV_POOL_SIZE, STV_POOL_NAME);
> stvPoolMem= (float *)pfDPoolAlloc(stvDataPool, STV_POOL_SIZE, STV_POOL_ID);
> ...
>
> loop part
> ...
> pfDPoolLock(stvPoolMem);
> ...
> pfDPoolUnlock(stvPoolMem);
> ...
>
> end part ...
> ...
> pfDPoolFree(stvDataPool, stvPoolMem);
> pfReleaseDPool(stvDataPool);
> ...
>
>
>
> SECOND PROGRAM ...
>
> start part
> ...
> while ((stvDataPool= pfAttachDPool(STV_POOL_NAME))==NULL)
> fprintf(stderr, "\t- Data Pool Attach ...\r");
> stvPoolMem= (float *)pfDPoolFind(stvDataPool, STV_POOL_ID);
> ...
>
> loop part
> ...
> pfDPoolLock(stvPoolMem);
> ...
> pfDPoolUnlock(stvPoolMem);
> ...
>
> end part
> ...
> pfReleaseDPool(stvDataPool);
> ...
>
> Any help is welcome ...

 Cedric (email: gce++at++syseca.fr)
 SYSECA Simulation Dept ...


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:39 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.