[ale] Linuxthreads question
John Mills
johnmills at speakeasy.net
Mon Jun 23 22:13:53 EDT 2003
ALErs -
I'll be happy to give a bit more info in exchange for a bit more advice!
On Mon, 23 Jun 2003, Christopher Fowler wrote:
> On Mon, Jun 23, 2003 at 04:16:25PM -0400, Armsby John-G16665 wrote:
> > What is it you want to do? Are you thinking of a C++ implementation?
Yes - I am writing a server to which a number of "writers" and "readers"
will attach. A given "reader" may request connection from any active
"writer". The server essentially switches any one or more readers onto any
active writer.
My plan was for each "writer" client and each "reader" client to open a
socket to the reader port or the writer port, resulting in a thread
'clone()' and within the thread, construction of a C++ instance of the
"reader" or "writer" class which would then handle that client's traffic.
> It seems from the email that he would like to implement some version
> of threads without using the native clone() system call. I think
> even pthreads under the hood uses clone() on Linux. It just adds
> a familiar interface that is portable. and some nifty locking features.
> I have not dived into the mutexs that deeply but I'm sure they are
> using semaphores behind the scenes. Are'nt semaphores wonderful?
Not quite: I don't want to implement any new type of thread, but just to
make sure I use the 'linuxthreads' version in which each thread gets a
different PID and won't block the others, but in which the threads can all
share their parent's data segment where I will put my buffers. I
specifically expect that I can avoid any locking, collision, or 'deadly
embrace' problems by using multiple rolling buffers. If semaphores are
used 'under the covers', I don't want to know about it.
The "thread" of my question was, how should I link to be sure I _do_ use
'linuxthreads' and get per-thread PIDs.
Thanks for further comments.
John Mills
john.m.mills at alum.mit.edu
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list