From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,3ca4240a4c402bae,start X-Google-Attributes: gidf7344,public X-Google-Thread: fc89c,3ca4240a4c402bae,start X-Google-Attributes: gidfc89c,public X-Google-Thread: ffc1e,3ca4240a4c402bae,start X-Google-Attributes: gidffc1e,public X-Google-Thread: 11035d,3ca4240a4c402bae,start X-Google-Attributes: gid11035d,public X-Google-Thread: fee84,3ca4240a4c402bae,start X-Google-Attributes: gidfee84,public From: philips@asiatech.co.za (philip Shearer) Subject: pthreads and sockets Date: 1996/12/06 Message-ID: <589ceq$g76$1@asgard.sprintlink.co.za>#1/1 X-Deja-AN: 202689006 organization: Asia Technology Inc keywords: threads sockets newsgroups: comp.programming.threads,comp.unix.osf.osf1,comp.unix.solaris,comp.unix.programmer,comp.os.vms I am assessing the possibility of replacing a network communications subsystem with a TCP/IP implementation using pthreads. It is the first pthreaded application I have attempted , but I have a lot of experience of this type of application on various UNIX systems using sockets and fork(ing). At the moment the sub-system runs as a server on VMS and a client on MS-Windows using UDP on one PORT. Built into the comms layer is an in-house reliable connection mechanism between the VMS server MS-Windows clients. The current sub-system works for about 550 connections but it is starting to become flaky as more clients are added. The development (of the server software) will be done on Solaris x86 V 2.5.0 and Digital UNIX 4.0. Ideally the server code should be portable to a VMS platform. Is is there anything that we need to do to the kernels of the 3 systems to allow for 1000 TCP connections? Is there any software on the Net which does this task or something similar. If not then at the moment I envisage having : One thread accepting connections and creating one new thread per connection. (Accepter) One thread read-blocking on the each socket connection. Each thread will write to an internal IPC that is connected to the main application.(Reader) One thread will read from an internal IPC to receive processed messages from the main application. (Dispatcher) One thread per-connection which will block waiting for the Dispatcher to send it a message with it will send out onto the network. (Writer) Is there a simple method by which the Dispatcher can multiplex to the correct Writer (assuming that any info needed to do this can be prefixed to the outgoing message by the main application) Or will I be forced to implement some sort of structure/lookup table containing a mutex lock for each Writer? Is there a better way to write this sort of code? -- Regards Philip Shearer eMail: philips@asiatech.co.za Tel +27 (0)11 784 8925 Fax +27 (0)11 784 8919