Network Programming: Multithreads

P

pradeepag

Hi all,
I want to implement a proxy server in C.
That proxy server stands there for several concurrent client requests
& services them.
Using select(), it is working fine.
But I want to make my proxy work more efficiently.
So What is the next thing I can do?

whether there is any more thing should added with select()?
or should I move away from select() and go for multithreaded...?
or select() + multithreads ?

If multithreads should come there, please can some one give a simple
explanation for thread implementation...simple code( I want to use
POSIX thread library)
Actually, I wrote it using thread ah!...
//server code
int main(){
while(true){
//create a thread using pthread.h create_pthread()
//thread_join();
}

ThreadFunction(){
// coded What should client do
}

I couldn't see thread concept is working there. server works for one
client and then next one(in order), but not switching between threads
when one is reading a file, other thread should in work. but....:-(

Thanks a lot.
Pradeepag
 
J

Joona I Palaste

pradeepag said:
Hi all,
I want to implement a proxy server in C.
That proxy server stands there for several concurrent client requests
& services them.
Using select(), it is working fine.
But I want to make my proxy work more efficiently.
So What is the next thing I can do?

Well, asking POSIX questions on comp.unix.programmer would be a start.

(Snip POSIX-specific code)
 
M

Mark McIntyre

Hi all,
I want to implement a proxy server in C.
That proxy server stands there for several concurrent client requests
& services them.
Using select(), it is working fine.
But I want to make my proxy work more efficiently.
So What is the next thing I can do?

ask in the right group. Everything you talk about above is offtopic
here. Try comp.unix.programming.
 
P

pradeepag

Thanks a lot for all your guide.
I was new to google groups....
And Even I put subject as Network programming, C and threads(how to
handle threads in C) were in my mind.

Thanks again.
pradeepag
 

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

Forum statistics

Threads
474,137
Messages
2,570,797
Members
47,345
Latest member
tektheone

Latest Threads

Top