how to run socket programme and file management concurrently


 
Thread Tools Search this Thread
Top Forums Programming how to run socket programme and file management concurrently
# 8  
Old 08-29-2006
Quote:
Originally Posted by matrixmadhan
this solution is only at the cost of an extra process and an additional load to the cpu...

fork a process to monitor - or look into memory refresh.. (close all the unnnecessary descriptors ..they are not needed )
while the other process can have a block at accept function call..

blowtorch .. in newer semantics of signals - reregistration of signals are not needed if we are enabling RESTART flag in the sigaction specification itself...
hi
the memory i refreshed is allocated in the programme,
both the socket programme and the file management shared the same memory. so i think there are synchronized problem , is it so?
# 9  
Old 08-29-2006
Quote:
Originally Posted by wwwdev
Hi benbenpig,

In my opinion you can do refresh after each blocking call, not every minute. Enough that will do. Isn't it so ?

Regards.
hi wwwdev

the idea you suggest is feasible,but i think the performance is lower
because during an hour ,there are many file need to be read into the memory
:-)
thanks
# 10  
Old 08-29-2006
This may be also interesting for you: http://beej.us/guide/bgnet/output/ht...et.html#select
# 11  
Old 08-29-2006
Quote:
Originally Posted by benbenpig
hi wwwdev

the idea you suggest is feasible,but i think the performance is lower
because during an hour ,there are many file need to be read into the memory
:-)
thanks
hi benbenpig,

I think the single-threaded program can't change any data during a blocking call, so you can insert the refreshing function after each call. It's comfortable sometimes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to run script concurrently

Hi all, I have one script. Its job is to get 1 file from dirA and 1 file from dirB as parameters for another python script. However, there are a lot of files in both dir A and B, so running this scripts really takes a lot of time. So I wonder if there are any ways that I can do this faster,... (6 Replies)
Discussion started by: yoyomano
6 Replies

2. AIX

Restore and upgrade concurrently

I have serveral servers that are at AIX 6.1 tl4 sp1 and want to move them to new hardware and upgrade them at the same time. Using NIM and sysback images I want to backup the current server with sysback and restore it and upgrade it to AIX 6.1 tl4 sp6 to the new hardware using my NIM server. My... (4 Replies)
Discussion started by: daveisme
4 Replies

3. UNIX for Dummies Questions & Answers

Help to run this socket program in C

i have created two files named server and client then when i run the server program it says the server is waiting(./server 5555) then when i run the client program it says "client error:connection refused" can u plz help me to run it?:( (7 Replies)
Discussion started by: kedah160
7 Replies

4. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

5. Programming

How to Run a Linux Command and Redirect its output to a socket in C

I have a Linux socket server program. I need to run the commands sent by the client and return the output to client. Is there a quicker way? I tried with ptr=popen(command, "r"); and then fgets(buf, size,ptr); write buf to socket fgets hangs for me. Now, I would like to know if I can... (3 Replies)
Discussion started by: rajeshomallur
3 Replies

6. Programming

cobol crn programme run on express cobol as .gnt

can i run .crn programme in express cobol which support to .gnt programme .... Plz tell me solution (2 Replies)
Discussion started by: bibi
2 Replies

7. Shell Programming and Scripting

Trimming files concurrently

I have a file which is written by an ongoing process (actually it is a logfile). I want to trim this logfile with a script and save the trimmed portion to another file or display it to <stdout> (it gets picked up there by another process). Fortunately my logfile has a known format (XML) and i... (3 Replies)
Discussion started by: bakunin
3 Replies

8. Shell Programming and Scripting

Running same script multiple times concurrently...

Hi, I was hoping someone would be able to help me out. I've got a Python script that I need to run 60 times concurrently (with the number added as an argument each time) via nightly cron. I figured that this would work: 30 1 * * * for i in $(seq 0 59); do $i \&; done However, it seems to... (4 Replies)
Discussion started by: ckhowe
4 Replies

9. Programming

Run 4-processes concurrently

How can i run a back ground process.... I.e for example by using fork() i need to run seperate 4 background processes.. How can send a process to background ??? (9 Replies)
Discussion started by: ugp
9 Replies

10. Shell Programming and Scripting

Executing multiple Oracle procedures concurrently

I am using KSH with an OS of AIX Version 5.3. From my shell script, that will be scheduled thorugh a CRON, I need to execute 2 Oracle stored procedures concurrently. If we execute them one at a time, the total execution time takes 4 hours or more. Since they are not dependent on each other and... (6 Replies)
Discussion started by: multidogzoomom
6 Replies
Login or Register to Ask a Question