Re: AW: Perl fork question

Sven Köhler <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
> 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().

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.
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.