Sponsored Content
Top Forums UNIX for Advanced & Expert Users Process based code vs. Thread based code Post 302234204 by ramen_noodle on Tuesday 9th of September 2008 09:55:27 AM
Old 09-09-2008
If you are handling clients on a system that must scale you will use neither. Using non-blocking I/O and a fast event mechanism like epoll or kqueue is a better answer.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

server based Including additional code > Lycos way

For a project we need to make sure that all php / html files in a certain directory on the webserver are showing advertisments of us. For example, when you get a website from Lycos, you'll have an advertisement in the right corner. How to? As far as I can see, Lycos includes a javascript... (1 Reply)
Discussion started by: valentijnb
1 Replies

2. Shell Programming and Scripting

Need your HELP:: Shell script to detect paragraph in coordinate-based code.

Hi Friends!! I have obtained following output from a tool called pdftoxml: <xml> <text top="423" left="521" width="333" height="20" font="3">Although the the number of fuzzy rules of a system is </text> <text top="441" left="500" width="355" height="20" font="3">directly dependant on these... (2 Replies)
Discussion started by: parshant_bvcoe
2 Replies

3. Shell Programming and Scripting

restart process based on file

Hi all. I do have a script "startApp.sh" (app result is a file /opt/extract/appextract.txt) I have no problems with stopping app var1=`ps -ef | grep -v grep | grep MyApp | awk '{print $2}'` kill -9 $var1 What I want to achieve is: I start app, app is doing some extraction, after... (11 Replies)
Discussion started by: e-l-diablo
11 Replies

4. Shell Programming and Scripting

How to fetch rows based on line numbers or based on the beginning of a word?

I have a file which will have rows like shown below, ST*820*316054716 RMR*IV*11333331009*PO*40.31 REF*IV*22234441009*xsss471-2762 DTM*003*091016 ENT*000006 RMR*IV*2222234444*PO*239.91 REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN> DTM*003* 091016 RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies

5. Shell Programming and Scripting

Running a process based on time

Hello All, My script is nearly complete, there is just one last piece that needs to be added in. I need to check for the time, and if it is lets say for example. Sunday at 5:00AM, my script cannot run. I would assume it would be something like this, parden the terrible pseudocode ... (7 Replies)
Discussion started by: jeffs42885
7 Replies

6. Shell Programming and Scripting

Script for running root based C++ code

Hi all, I have to run C++ file using root programming, using following commands: $root -l root .L TwoTrees.C++ root TwoTrees t root t.Loop() root.q I wonder if I can write script to do the following. Thanks Pooja (12 Replies)
Discussion started by: nrjrasaxena
12 Replies

7. Shell Programming and Scripting

Appending code in a directory recursively based on a certain criteria

i am stuck with this strange problem..... maybe you can help. i have one master_file which has two column username and id_number separated by , somewhat like : cat master_file : sample,1234567 javacode,4567891 companion,23456719 adamsandler,1237681 tomcruise,56328910 bradpitt,901236781... (9 Replies)
Discussion started by: mukulverma2408
9 Replies

8. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies

9. Shell Programming and Scripting

Code snippet to cut XML files based on record length

I want to do FTP an Huge XML file to mainframe server using AIX server Since my file size is huge, i want to split the XML file based on a delimiter , the record delimiter should be set after every 27000 bytes of data and then do the ftp This is done becos the data send to the mainframe must... (1 Reply)
Discussion started by: vishwanath001
1 Replies

10. Programming

C++ separate code based on the few changes

Hi, I am working in Visual studio 2008 in which i have written the code in c++,qml,qt.Its a simulator application. I would like to create a simulator with certain changes. In order to do that i have modified the code with few changes based on the preprocessor condition. #define... (4 Replies)
Discussion started by: SA_Palani
4 Replies
EPOLL_CTL(2)						     Linux Programmer's Manual						      EPOLL_CTL(2)

NAME
epoll_ctl - control interface for an epoll descriptor SYNOPSIS
#include <sys/epoll.h> int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); DESCRIPTION
This system call performs control operations on the epoll instance referred to by the file descriptor epfd. It requests that the operation op be performed for the target file descriptor, fd. Valid values for the op argument are : EPOLL_CTL_ADD Register the target file descriptor fd on the epoll instance referred to by the file descriptor epfd and associate the event event with the internal file linked to fd. EPOLL_CTL_MOD Change the event event associated with the target file descriptor fd. EPOLL_CTL_DEL Remove (deregister) the target file descriptor fd from the epoll instance referred to by epfd. The event is ignored and can be NULL (but see BUGS below). The event argument describes the object linked to the file descriptor fd. The struct epoll_event is defined as : typedef union epoll_data { void *ptr; int fd; uint32_t u32; uint64_t u64; } epoll_data_t; struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */ }; The events member is a bit set composed using the following available event types: EPOLLIN The associated file is available for read(2) operations. EPOLLOUT The associated file is available for write(2) operations. EPOLLRDHUP (since Linux 2.6.17) Stream socket peer closed connection, or shut down writing half of connection. (This flag is especially useful for writing simple code to detect peer shutdown when using Edge Triggered monitoring.) EPOLLPRI There is urgent data available for read(2) operations. EPOLLERR Error condition happened on the associated file descriptor. epoll_wait(2) will always wait for this event; it is not necessary to set it in events. EPOLLHUP Hang up happened on the associated file descriptor. epoll_wait(2) will always wait for this event; it is not necessary to set it in events. EPOLLET Sets the Edge Triggered behavior for the associated file descriptor. The default behavior for epoll is Level Triggered. See epoll(7) for more detailed information about Edge and Level Triggered event distribution architectures. EPOLLONESHOT (since Linux 2.6.2) Sets the one-shot behavior for the associated file descriptor. This means that after an event is pulled out with epoll_wait(2) the associated file descriptor is internally disabled and no other events will be reported by the epoll interface. The user must call epoll_ctl() with EPOLL_CTL_MOD to rearm the file descriptor with a new event mask. RETURN VALUE
When successful, epoll_ctl() returns zero. When an error occurs, epoll_ctl() returns -1 and errno is set appropriately. ERRORS
EBADF epfd or fd is not a valid file descriptor. EEXIST op was EPOLL_CTL_ADD, and the supplied file descriptor fd is already registered with this epoll instance. EINVAL epfd is not an epoll file descriptor, or fd is the same as epfd, or the requested operation op is not supported by this interface. ENOENT op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not registered with this epoll instance. ENOMEM There was insufficient memory to handle the requested op control operation. ENOSPC The limit imposed by /proc/sys/fs/epoll/max_user_watches was encountered while trying to register (EPOLL_CTL_ADD) a new file descriptor on an epoll instance. See epoll(7) for further details. EPERM The target file fd does not support epoll. CONFORMING TO
epoll_ctl() is Linux-specific, and was introduced in kernel 2.5.44. NOTES
The epoll interface supports all file descriptors that support poll(2). BUGS
In kernel versions before 2.6.9, the EPOLL_CTL_DEL operation required a non-NULL pointer in event, even though this argument is ignored. Since Linux 2.6.9, event can be specified as NULL when using EPOLL_CTL_DEL. Applications that need to be portable to kernels before 2.6.9 should specify a non-NULL pointer in event. SEE ALSO
epoll_create(2), epoll_wait(2), poll(2), epoll(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-08-29 EPOLL_CTL(2)
All times are GMT -4. The time now is 11:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy