09-09-2008
Hi ,
Mostly the diffrence is in execution time.threads require less time to execute,whereas the execution speed is more with processes.
you can get the user space/system space time using getrusage() function call.
By comparing the execution time you can decide between threads & processes.
But one more thing with threads you have to deal with synchronization.
best luck.
Raj
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
For a project we need to make sure that all php / html files in a certain directory on the webserver are showing advertisments of us.
For example, when you get a website from Lycos, you'll have an advertisement in the right corner.
How to?
As far as I can see, Lycos includes a javascript... (1 Reply)
Discussion started by: valentijnb
1 Replies
2. Shell Programming and Scripting
Hi Friends!!
I have obtained following output from a tool called pdftoxml:
<xml>
<text top="423" left="521" width="333" height="20" font="3">Although the the number of fuzzy rules of a system is </text>
<text top="441" left="500" width="355" height="20" font="3">directly dependant on these... (2 Replies)
Discussion started by: parshant_bvcoe
2 Replies
3. Shell Programming and Scripting
Hi all.
I do have a script "startApp.sh" (app result is a file /opt/extract/appextract.txt)
I have no problems with stopping app
var1=`ps -ef | grep -v grep | grep MyApp | awk '{print $2}'`
kill -9 $var1
What I want to achieve is:
I start app, app is doing some extraction, after... (11 Replies)
Discussion started by: e-l-diablo
11 Replies
4. Shell Programming and Scripting
I have a file which will have rows like shown below,
ST*820*316054716
RMR*IV*11333331009*PO*40.31
REF*IV*22234441009*xsss471-2762
DTM*003*091016
ENT*000006
RMR*IV*2222234444*PO*239.91
REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN>
DTM*003*
091016
RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies
5. Shell Programming and Scripting
Hello All,
My script is nearly complete, there is just one last piece that needs to be added in.
I need to check for the time, and if it is lets say for example. Sunday at 5:00AM, my script cannot run.
I would assume it would be something like this, parden the terrible pseudocode
... (7 Replies)
Discussion started by: jeffs42885
7 Replies
6. Shell Programming and Scripting
Hi all,
I have to run C++ file using root programming, using following commands:
$root -l
root .L TwoTrees.C++
root TwoTrees t
root t.Loop()
root.q
I wonder if I can write script to do the following.
Thanks
Pooja (12 Replies)
Discussion started by: nrjrasaxena
12 Replies
7. Shell Programming and Scripting
i am stuck with this strange problem..... maybe you can help.
i have one master_file which has two column username and id_number separated by , somewhat like :
cat master_file :
sample,1234567
javacode,4567891
companion,23456719
adamsandler,1237681
tomcruise,56328910
bradpitt,901236781... (9 Replies)
Discussion started by: mukulverma2408
9 Replies
8. UNIX for Dummies Questions & Answers
Below is the sample logfile:
Userids Date Time
acb Checkout time: 2013-11-20 17:00
axy Checkout time: 2013-11-22 12:00
der Checkout time: 2013-11-17 17:00
xyz Checkout time: 2013-11-19 16:00
ddd Checkout time: 2013-11-21 16:00
aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies
9. Shell Programming and Scripting
I want to do FTP an Huge XML file to mainframe server using AIX server
Since my file size is huge, i want to split the XML file based on a delimiter , the record delimiter should be set after every 27000 bytes of data
and then do the ftp
This is done becos the data send to the mainframe must... (1 Reply)
Discussion started by: vishwanath001
1 Replies
10. Programming
Hi,
I am working in Visual studio 2008 in which i have written the code in c++,qml,qt.Its a simulator application.
I would like to create a simulator with certain changes. In order to do that i have modified the code with few changes based on the preprocessor condition.
#define... (4 Replies)
Discussion started by: SA_Palani
4 Replies
LEARN ABOUT OSF1
thread_terminate
thread_terminate(9r) thread_terminate(9r)
NAME
thread_terminate - General: Prepares to stop or stops execution of the specified kernel thread
SYNOPSIS
kern_return_t thread_terminate(
thread_t thread_to_terminate );
ARGUMENTS
Specifies a pointer to the thread structure associated with the kernel thread that you want to terminate. This pointer was returned in a
previous call to the kernel_isrthread or kernel_thread_w_arg routine.
DESCRIPTION
The thread_terminate routine prepares to stop or permanently stops execution of the specified kernel thread. You created and started this
kernel thread in a previous call to the kernel_isrthread or kernel_thread_w_arg routine. These routines return a pointer to the thread
structure associated with the newly created and started kernel thread. Kernel modules use this pointer as a handle to identify the specific
kernel thread that thread_terminate stops executing.
Typically, a kernel thread terminates itself. However, one kernel thread can terminate another kernel thread. A kernel thread that termi-
nates itself must call thread_halt_self immediately after the call to thread_terminate. The reason for this is that thread_terminate only
prepares the self-terminating kernel thread to stop execution. The thread_halt_self routine completes the work needed to stop execution
(by performing the appropriate cleanup work) of the self-terminating kernel thread.
Specifically, the thread_terminate routine works as follows: For terminating other kernel threads
The thread_terminate routine stops execution of the specified kernel thread, frees any resources associated with that kernel thread,
and thus makes the kernel thread unavailable. To make the kernel thread available again, you need to create it by calling ker-
nel_isrthread or kernel_thread_w_arg. A kernel thread terminates itself
The thread_terminate routine prepares to stop execution of the kernel thread that needs to terminate itself. The thread_halt_self
routine completes the work needed to stop execution of the self-terminating kernel thread by performing the appropriate cleanup
work. After you call these routines, the self-terminating kernel thread becomes unavailable until you create it again by calling
kernel_isrthread or kernel_thread_w_arg.
NOTES
You do not need to terminate every kernel thread that you create. You should not terminate a kernel thread that is waiting for some event.
The basic rule is that you should terminate only those kernel threads that you do not need anymore. For example, if a dynamically config-
ured kernel module uses kernel threads, you should terminate them in the CFG_OP_UNCONFIGURE entry point of the loadable module's configure
routine. The kernel threads are no longer needed after the module is unconfigured.
Note that the thread_terminate routine (for kernel threads that terminate other kernel threads) not only permanently stops execution of the
specified kernel thread, but it also frees any resources associated with that kernel thread; thus, this kernel thread can no longer be
used.
RETURN VALUES
Upon successfully terminating the specified kernel thread, thread_terminate returns the constant KERN_SUCCESS. If the thread structure
pointer passed to the thread_to_terminate argument does not identify a valid kernel thread, thread_terminate returns the constant
KERN_INVALID_ARGUMENT. On any other error, thread_terminate returns the constant KERN_FAILURE.
SEE ALSO
Data Structures: thread(9s)
Routines: kernel_isrthread(9r), kernel_thread_w_arg(9r), thread_halt_self(9r)
thread_terminate(9r)