AW: Perl fork question

"Mosebach, Kai" <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Organization Komadev
Message-ID <000101c35cef$b5bce320$0100a8c0@alpha>
> > > Isnt it somewhat overheaded to open a new database connection on
every
> > > fork, or was it designed for a usage like that ?
> >
> > Are you aware of what a fork()-call does?
> > The forked process inherits all the handles from it's parent.
Therefor
> > your child process would operate on the same socket as the parent
> > process without knowing what the parent-process is doing right now.
> > You see that your child process needs to open a new connection to
> > independantly communicate with the database.
> >
> > It's not so much the design of the SAPDB driver but the things you
have
> > to pay attention to if you do a fork().
> 

Afaik, mysql has no problems with it (ok mysql is another level of
stability  and safety ...)


> 
> >
> > A better concept would be to have 20 child processes which are
feeded by
> > the parent process which consumes the results of the child processes
and
> > put's them into the database.
> > You'll have to use pipes for that.
 
Making an application out of a quick perl hack ... :(
 
> >
> >
> > _______________________________________________
> > sapdb.general mailing list
> > [email protected]
> > http://listserv.sap.com/mailman/listinfo/sapdb.general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.