09-08-2008
Which IPC between multiple threads will suit most in scenerio?
Hi Friends,
I am designing a solution for a problem: in which my master thread receiving network message and processing them, during processing of each message i need to communicate remote database (that is actually a separate external module)that cause a delay of arount 2 second (), After getting result from external database module i can complete processing of my each incomming message. from now i have to ensure that if i was processing 600 message per second (this was the case when i was not communicating remote database) earlier when i was not using remote database that is causing delay.. this time my message processing should not affect due to remote database interaction. Does there is a solution through creating multiple threads and IPC (memory queue or shared memory) so that i can minimize my delay at remote database query.
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I have a program that runs two threads in stead of two processes. I want to use pipe to redirect the output of the first thread to the input of the second thread.
One thread is continuously writing to a pipe, and the other thread will read from the pipe.
How do I do that?
Is there... (2 Replies)
Discussion started by: wminghao
2 Replies
2. Programming
hi all!
I wanted to know how to synchronize multiple threads in unix
It would be better if someone give some code samples
Thanx (1 Reply)
Discussion started by: bankpro
1 Replies
3. IP Networking
Hi All,
Please explain me when i have to use multiple process and when I have to use Multiple threads? Please give me an example.It will be very helpful for me.
Thanks in advance. (0 Replies)
Discussion started by: ashleykumar
0 Replies
4. Shell Programming and Scripting
Hi,
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks (5 Replies)
Discussion started by: neeto
5 Replies
5. Programming
Hi,
Can anyone give me any idea when multiple processes access a file (like opening it, modifying it etc.) how can the synchronization can be done if they can access the same file at any time? How can this scenario is different from when multiple threads access a same file, modifying it etc- in... (7 Replies)
Discussion started by: sanzee
7 Replies
6. UNIX for Dummies Questions & Answers
Hello all,
I have a directory of files of varying sizes.
I want to copy all these files in n number of threads to another directory such that each
copy set is more or less the same size.
Example :
Say /mydirA
It has around say 23 files of various sizes.
Number of copy... (0 Replies)
Discussion started by: samoo
0 Replies
7. Solaris
I was asked to look into a problem with a Sun Netra 440 in another department. On the server in question, the relevant 'uname -a' information is, "SunOS host1 5.9 Generic_118558-16 sun4u sparc SUNW,Netra-440". That information aside, while the other admin is logged into the ALOM, these errors are... (0 Replies)
Discussion started by: Borealis
0 Replies
8. Shell Programming and Scripting
Hi,
I have a list of URLs in a csv file which I'm checking for page status. It just prints the URL and the status as output. This works perfectly fine.
I'm looking to run this in multiple threads to make this process faster.
I'm pretty new to Perl and I managed to complete this. It would be... (9 Replies)
Discussion started by: kzenthil
9 Replies
9. Shell Programming and Scripting
Hello,
In a unix Solaris environment, (for simulation) how to start multiple threads (as Light Weight Process, not background process)?
thanks,
J. (7 Replies)
Discussion started by: seafan
7 Replies
10. Shell Programming and Scripting
Hi , i need to run multiple scripts parallely ,on my server....i have 8 cpus . planning to run minimum of 6 scripts paralley ....could you please suggest someone .
thanks in advance , (3 Replies)
Discussion started by: Huvan
3 Replies
ptem(7) Miscellaneous Information Manual ptem(7)
NAME
ptem - STREAMS pty (pesudo-terminal) Emulation module
SYNOPSIS
DESCRIPTION
is a STREAMS module that emulates a terminal when used in conjunction with (STREAMS line discipline) and (STREAMS slave pty driver). The
module normally sits above and below The user process must push the module onto the slave side of the pty with a call to the STREAMS
ioctl(2) system call before is pushed. is responsible for processing all of the terminal commands that are passed downstream from or from
(STREAMS pty master driver).
and together provide a real terminal behavior for the STREAMS pty slave. However, some of the terminal commands are ignored and cause only
an acknowledgement of the command since there is no real terminal or modem in the pty subsystem. In fact, none of the flags in the field
of the or structures, (which is used by the or respectively), have any effect on the pty except if the baud rate is set to zero. Setting
the baud rate to zero will have the effect of hanging up the pty connection. Similarly, the parity or delay flags in the field will not
have any effect at all on the pty.
As a summary, the module performs the following tasks:
o The following are processed, if appropriate, and acknowledged by sending an message upstream when they are received on write
queue:
and
o Keeps track of the window size needed for the and
o Upon receiving any other on its write queue, acknowledges them negatively by sending an message upstream.
o The following are passed downstream by after they have been processed:
and
o Any message that is received on read queue will be freed in case the module is not pushed on the and the above get to the pty
master STREAMS head, which would then send an message downstream.
o When is opened and all conditions for setting up a controlling terminal are met, it sends an message (with the flag set) upstream
to the STREAMS head to allocate a controlling terminal.
o Upon receiving an message of type on its read queue, sends an message downstream and an message upstream.
o When an message is received on its write queue to set the baud rate to zero (e.g. with CBAUD set to B0), sends an message
upstream and a zero-length message downstream to be read by the pty master process.
o When an message of type is received on its read queue, sends an message downstream and an message upstream with the signal number
set to the same value used in the message.
o When an message of type is received on its read queue, sends an message downstream and an message (with ioc_cmd set to or
upstream to enable or disable the input processing on
o When an message is received on its read or write queue, simply discards the message without any action.
o When an message of type is received on its write queue and if the values in the structure in are not zero, sends an message
upstream with the structure. If the values are zero, sends an message upstream.
o When an message of type is received on its write queue and if the values in the structure in are not zero, sends an message
upstream with the structure. If the values are zero, sends an message upstream.
o When an message of type is received in its write queue, saves the information passed to it in the structure and sends an (with
the signal number set to upstream to the pty slave process if the window size is changed.
o When an message of type is received on its read queue and if the values in the structure in are not zero, sends an message down-
stream with the structure. If the values are zero, sends an message downstream.
o When an message of type is received in its read queue, saves the information passed to it in the structure and sends an (with the
signal number is set to upstream to the pty slave process if the window size is changed.
o All other messages not mentioned above are passed to the next module or driver.
AUTHOR
was developed by HP.
SEE ALSO
ioctl(2), streamio(7), ptm(7), pts(7), ldterm(7).
ptem(7)