Re: Managing Multiple Connections
Re: Managing Multiple Connections
- Subject: Re: Managing Multiple Connections
- From: Lyndsey Ferguson <email@hidden>
- Date: Wed, 21 May 2003 09:18:28 -0400
I'm not an expert, but if you're creating a thread and not a process (via
fork()), then that thread shares the same resources and address space as the
main process/thread it was created in. It has its own stack though.
So, you can communicate with globals or memory that is accessed from both
threads, but make sure you use synchronization (such as mutex locks and
unlocks, etc) either wise you risk problems.
I recommend the book: "Object-Oriented Multithreading using C++" by Cameron
and Tracey Hughes. I got my copy for $20 from half.com.
I hope this addresses your question.
Lyndsey Ferguson
On 5/21/03 4:05 AM, "Dietrich Epp" <email@hidden> wrote:
>
What is a good way to manage multiple connections (OSX)? Most of my
>
documentation is UNIX-specific, and my first thought was to create a
>
thread that manages all connections using the select(2) system call.
>
Unfortunately, this means that communication with the thread must
>
either be done using a timeout (ick), signals (double ick), or file
>
descriptors (ick squared). My second thought is to create a thread for
>
each connection, but this seems excessive.
>
>
I'm sure this situation is relatively common (e.g. downloading things
>
in a web browser) and I'm probably making things more complicated than
>
they should be.
>
>
Is there some good technique I'm missing? It would be great if it were
>
cross-platform, but OSX-specific is good too.
>
>
--Dietrich
>
_______________________________________________
>
macnetworkprog mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
>
Do not post admin requests to the list. They will be ignored.
>
--
Lyndsey D. Ferguson
Software Engineer
Nemetschek N.A., Inc.
email@hidden
--
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.