473,651 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2459
Animesh <an*****@neolin uxsolutions.com > wrote:
I need to know the perfect "Concurrent Network Server" design for the
above problem.


(You're looking more for comp.programmin g, 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)cybers pace.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.progr ammer.

Regards,
Animesh

Dec 24 '05 #4

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

Similar topics

1
3290
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 as this is the reason (security) that I want to restrict their selection. Any help on this one will be greatly appreciated. The page is using ASP.NET.
4
6499
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; HEIGHT: 24px" type="reset" value="Reset" name="btnReset1" runat="server"> Using Interdev I then double click the button in design view and in the code behind page (aspx.vb) have the following:
1
22563
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. Does anyone know what reference to add and what to import? Dim drives() As String Dim ob As Object = CreateObject("WScript.Network") Dim odrives As Object = ob.EnumNetworkDrives dim k as integer If odrives.count > 0 Then
1
1144
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 Remote Server on our WAN, I get prompted with a Network Login dialog. I key in the correct credentials for my account, and it simply flips right back to the Network Login dialog again.
6
16169
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
2550
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 like displaying some message at client side only without hitting server? what is the use of onclick, as we have to use onserverclick always? why it is not possible to do the things without using runat="server" in script?
2
5558
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" type="text/vbscript"> Option Explicit On Error Resume Next
0
1133
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 be running into that old Network Token issue from Classic ASP. I had solved this in the past by writing a .COM component to impersonate the same user as the requester but as a "real" token
3
1502
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". My question is, is it possible to create a new connection by using Python script? which means I do not want to use Window UI (via "control panel"), if it is possible, I can save so many time to create various network connection when I want to do...
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.