473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help with "Concurrent Network Server" Design

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

Dec 23 '05 #1
3 2442
Animesh <an*****@neolinuxsolutions.com> wrote:
I need to know the perfect "Concurrent Network Server" design for the
above problem.


(You're looking more for comp.programming, where they may very well
recommend "Design Patterns" by the Gang of Four. GIYF.)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Dec 23 '05 #2
Animesh wrote:

<snip>
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.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Dec 23 '05 #3

Flash Gordon wrote:

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

Dec 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark Sandfox | last post by:
Is there a way to restrict the user to only selecting and sending either a ..gif or .jpg. Everything I have read says this option can not be done by design (security reasons). I find that irronic...
4
by: Ryan | last post by:
Hello, I have a standard HTML button on an aspx web form that I have set to runat server. The button is named reset1 and its tag is as follows: <INPUT id="btnReset1" style="WIDTH: 60px;...
1
by: Dennis | last post by:
I use the below code to get the Network Places items. However, this requires "Late Binding". I read that you can avoid late binding by adding a reference to the Com Types in your application. ...
1
by: cider123 | last post by:
I don't know what our Server Admins changed, or if it's something else. I'm in the Administrator group on this Server, so I don't know what else they may need. When I attempt to publish to a...
6
by: alessandro | last post by:
Hi all, This is my framework for create TCP server listening forever on a port and supporting threads: import SocketServer port = 2222 ip = "192.168.0.4"
11
by: gunjan.mait | last post by:
hi, i wanted to know the exact use of runat="server" which is being used is ASP.NET why we every time need to use it, even when i want to do the work at client side? How to do simple processings...
2
by: moodyman13 | last post by:
Hi all, Hoping someone can help me. I'm using WSH to automatically map a network drive when someone opens a webpage. Below are the codes <HTML> <Body> <script language="VBScript"...
0
by: kellygreer1 | last post by:
I'm writing an .ashx page that needs to be able to write files to a network share. Example: string fullPath = @"\\someserver\someshare\log.txt"; File.WriteAllText(fullPath,"test"); I seem to...
3
by: Evan | last post by:
Hello, one of my PC is window system, and in "control panel -Network Connections", I can see some network connections such as PPPOE or VPN which I created by click "create a new connection". ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.