Sponsored Content
Full Discussion: Share CPU core
Operating Systems Solaris Share CPU core Post 302408700 by falloutsam on Tuesday 30th of March 2010 08:35:44 AM
Old 03-30-2010
Hi,

When I use mpstat command, I wish to see 4 or 5 CPU virtual core used.
But only one virtual core is using.
Maybe my script don't need more CPU and I need to modify my script with threads module for example.
Because my script read one line in a source file and put it in an output file.
I can put into memory 10000 lines with a thread, and put in an output file 10000 lines

Code:
 
#!/usr/local/perl/bin/perl
use warnings;
use strict;
use threads;
sub ProcessLog{
        my $l__line = "";
        my $i = 0;
        my $core=0;
        while ( defined($l__line = <INPUT_FILE>)){
            chomp($l__line);
            $i++;
            $core=0;
            if($i==10000){
                $i=1;
            } 
            if($i==1){ 
                 $core++;
                 my $thr = threads->new(\&sub1,$l__line);
                 if($core==32){
                     $thr->join;
                 }
                 sub sub1 {
                     #print "In the thread\n";
                     my $line=$_[0];
                     #print "LINE:".$line;
                     if ($line ne ""){
                         my $val1="";
                         my $val2="";
                         my $val3="";
                         if(defined $line){
                             ($val1,$val2,$val3)=split(/ /,$line);
                         }
                         my $l__newLine = $val1.";".$val3;
                         print OUTPUT_FILE $l__newLine."\n";
                         #return($l__newLine."\n");
                     }
                 }
            }
        }
}
my $l__logInput = $ARGV[0];
my $l__logOutput = $ARGV[1];
open(INPUT_FILE, "< $l__logInput") || die "probleme d'ouverture du fichier de lecture\n";
open(OUTPUT_FILE, "> $l__logOutput") || die "probleme d'ouverture du fichier d ecriture\n";
&ProcessLog;

Thanks
 

9 More Discussions You Might Find Interesting

1. AIX

cpu and core

Hi, what is concept of core in ibm platform? I want to know how to find out no of core in cpu in aix i.e command how to find out value of core? Wheather any specification is there? (1 Reply)
Discussion started by: manoj.solaris
1 Replies

2. Solaris

cpu core level from solaris os [8,9,10]

hi all how to find cpu core level in 8,9 and 10 . thanks (2 Replies)
Discussion started by: kumarmani
2 Replies

3. AIX

no of core in cpu for aix

is there command which will display no of core per cpu in aix? Regads, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

4. UNIX for Advanced & Expert Users

How maney CPU and core?

Hi, Is it a command that show's how many CPU and Core the solaris server have? Tnx (2 Replies)
Discussion started by: mehrdad68
2 Replies

5. UNIX for Advanced & Expert Users

Distinguishing between CPU and Core

Hi, I want to know if in UNIX is it possible to distinguish between a CPU and a core through any command? Thanks, Vineet (1 Reply)
Discussion started by: vineetd
1 Replies

6. Solaris

Restricting CPU Core Access

Hi all. I've had a quick look around but cant see anything exactly matching my requirements. I have a new T2000 running S10. Im looking to restrict the no. cores that a S10 non-global zone can use to 1 only. The box is single CPU but 8core. I want to do this to save on some software... (4 Replies)
Discussion started by: boneyard
4 Replies

7. AIX

What is a cpu core ?

Hi Friends- What does it mean by 2 cpu cores, 3 cpu cores? Does it mean 2 separate cpus or what is it exactly ? Kindly explain a bit in detail. Thanks panditt (4 Replies)
Discussion started by: deshaipet
4 Replies

8. Red Hat

No of CPU's and No of Core

I would like to understand how many number of CPUs and cores do I have on my server based on following out put.. Few observations... Please correct me if I am wrong Since Physical ID is same CPU is singe It has 8 virtual processors Hyper thrading is enabled since no of siblings are... (1 Reply)
Discussion started by: parth_buch
1 Replies

9. Solaris

Assigning cpu/core to globalzone

hi all, I am running SPARC server + solaris 10. (no LDOMs) Due to change of setup and application licensing cost, I need to cap my core/cpu utilization in my globalzone. Right now, I have 1x6 cores in my server, how do I change it to utilized 4 cores instead ? By using... (2 Replies)
Discussion started by: javanoob
2 Replies
DDB(8)							    BSD System Manager's Manual 						    DDB(8)

NAME
ddb -- configure DDB kernel debugger properties SYNOPSIS
ddb capture [-M -core] [-N -system] print ddb capture [-M -core] [-N -system] status ddb script scriptname ddb script scriptname=script ddb scripts ddb unscript scriptname ddb pathname DESCRIPTION
The ddb utility configures certain aspects of the ddb(4) kernel debugger from user space that are not configured at compile-time or easily via sysctl(8) MIB entries. To ease configuration, commands can be put in a file which is processed using ddb as shown in the last synopsis line. An absolute pathname must be used. The file will be read line by line and applied as arguments to the ddb utility. Whitespace at the beginning of lines will be ignored as will lines where the first non-whitespace character is '#'. OUTPUT CAPTURE
The ddb utility can be used to extract the contents of the ddb(4) output capture buffer of the current live kernel, or from the crash dump of a kernel on disk. The following debugger commands are available from the command line: capture [-M core] [-N system] print Print the current contents of the ddb(4) output capture buffer. capture [-M core] [-N system] status Print the current status of the ddb(4) output capture buffer. SCRIPTING
The ddb utility can be used to configure aspects of ddb(4) scripting from user space; scripting support is described in more detail in ddb(4). Each of the debugger commands is available from the command line: script scriptname Print the script named scriptname. script scriptname=script Define a script named scriptname. As many scripts contain characters interpreted in special ways by the shell, it is advisable to enclose script in quotes. scripts List currently defined scripts. unscript scriptname Delete the script named scriptname. EXIT STATUS
The ddb utility exits 0 on success, and >0 if an error occurs. EXAMPLES
The following example defines a script that will execute when the kernel debugger is entered as a result of a break signal: ddb script kdb.enter.break="show pcpu; bt" The following example will delete the script: ddb unscript kdb.enter.break For further examples, see the ddb(4) and textdump(4) manual pages. SEE ALSO
ddb(4), textdump(4), sysctl(8) HISTORY
The ddb utility first appeared in FreeBSD 7.1. AUTHORS
Robert N M Watson BUGS
Ideally, ddb would not exist, as all pertinent aspects of ddb(4) could be configured directly via sysctl(8). BSD
December 24, 2008 BSD
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy