Help with "Concurrent Network Server" Design

A

Animesh

Hi All,

I have a lexical analyzer in flex/bison associated with a lot of custom
C function calls linking to external programs which uses quite a lot of
global variables and data structures. The program is quite complex and
does a lot of Natural Language Processing. The program needs to
initialize a few databases from files every time it launches and needs
to load them in the memory.

I am currently thinking of a design where I could run the program as a
"Concurrent Network Server" and connect to it each time I want to
process some text input. There are the following problems:
1. Since I use global variables (which cannot be avoided) I need to
make sure that for each new connection, I need to initialize all these
global variables and data structures.
2. Due to the above reason I probably need a new process Image for
every new connection. I have tried using fork but sometimes the global
variables are not properly initialized. Another problem I believe is
that I would very soon finish the fork limit for the OS, since there
are hundreds of subsequent connections.

I need to know the perfect "Concurrent Network Server" design for the
above problem. I am currenlty using Debian GNU/Linux with Kernel 2.4.18
as my primary development machine (I know this is ancient, but there
are other programs which run only with GCC 2.95). I have also ported
the program and not the experimental Network code to FreeBSD
6.0-RELEASE.

I am not much of a OS and Network Programming Guy, but am quite
comfortable with C Porgramming and Data Structures. I would really
appreciate if anybody could help me out.

Thanks in Advance,
Animesh
 
F

Flash Gordon

Animesh wrote:

I need to know the perfect "Concurrent Network Server" design for the
above problem.

1) The C programming language knows nothing about networks so this is
off topic here.
2) The C programming language has no support for concurrency, so this is
off topic here.
3) There is no such thing as a perfect design, so the answer is, "it
does not exist."
I am currenlty using Debian GNU/Linux with Kernel 2.4.18

<snip>

Then I suggest you try asking on a Linux group, there are plenty of them
available. We only deal with standard C here, not the specifics of every
system and every extension library.
 
C

Christopher Benson-Manica

A

Animesh

Flash said:
Then I suggest you try asking on a Linux group, there are plenty of them
available. We only deal with standard C here, not the specifics of every
system and every extension library.
--

Thanks Flash & Christopher,

I will head to comp.unix.programmer.

Regards,
Animesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top