right. locking doesn't help in this case. ;-)
however - isn't there a possibility to
a) generate something like
"a socket for each local connection attempt" (
ResourcePool::Factory ??) within the
deamon.pl, which collects the different
application.pl's data and
b) pump the data from the different socket connections to a "general/shared queue" in
deamon.pl
like this pseudo-code
deamon.pl:
$queue = generate_global_ressource();
create_socket_pool(max_sockets = 200);
while(1=1){
if($input=connection_attempt) {
if($input ne 'finish') {
push($fetched_data_from_socket, queue);
} else {
close_socket();
create_new_socket_in_socket_pool();
}
}
(where generate_global_ressource() is something like ResourcePool::Command::DBI::Execute)
because all i need that deamon for are INSERT statements, the applications don't need to wait for return values. they should only "dump" the sql statements to a socket without caring what happens. (also there is a quite generous error-tolerance here: i don't care for lost data, as long as it doesn't exceed 5-10%...)
i still don't get:
a) how to keep a number of opened sockets in stock for the different
application.pl which all use THE SAME port; and
b) how to use
deamon.pl's general $queue AS a general queue for the several connection instances...
jdporter fixed code formatting and CPAN links
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.