Jean-Francois Richard 2275 (jfr++at++cae.ca)
Thu, 14 Oct 93 19:06:41 EDT
>
>Date: Thu, 14 Oct 93 11:16:05 -0700
>From: jrohlf++at++tubes.asd.sgi.com (John Rohlf)
>Subject: Re: Performer: Using very large databases
>
>
>You can make libpr but not libpf calls from the database
>loading process. libpf calls modify a global structure that can
>be a source of contention if multiple processes make libpf calls
>in parallel. Another option is to use a lock to guarantee that the
>database and application processes do not make libpf calls at the
>same time.
>
>What I suggest is:
>
>1. Load the file from disk into main memory in the database process.
>2. Use a lock around each libpf call or group of calls.
>
> ussetlock(libpfLock);
> pfAddChild(a, b);
> usunsetlock(libpfLock);
>
>If you are using the .flt loader then you will need to get and
>modify the source code.
>
>I realize this is painful but rest assured that we are aware of this
>problem and consider it a high priority.
>
>
Thanks for the tip, John. This should be good enough for now... once
I figure out how to initialize my database process in order to access
the shared arena.
I am currently using the following utterly useless piece of code to test
out the parallel processing approach (I haven't put in the suggested lock
calls yet):
...
static void *arena;
...
main()
{
...
pfInit( );
arena = pfGetSharedArena( );
pfMultiprocess( PFMP_DEFAULT );
pfConfig( );
if( !fork() )
fvd_loader( );
...
}
fvd_loader( void )
{
char *buf;
buf = pfMalloc( 1000, arena );
for( ; ; );
}
The forked process hangs in pfMalloc() (no, it doesn't get
stuck in the for loop -- I checked with dbx). I tried replacing
pfMalloc() with amalloc() (should that work?) and got the same
result. I tried moving the fork() around, as suggested by Lance R.
Marrou, and got the same result or worse. I figure I'm probably missing
something that should be obvious. Any idea what it is?
By the way, will an improved solution to the parallel
loading problem make it into the Release version of 1.2, or is it
just on a long wish list?
----------------------------------------------------------------------
J.F. Richard, jfr++at++cae.ca
CAE Electronics
----------------------------------------------------------------------
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:03 PDT