Perl how to make the 2nd CPU full?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl how to make the 2nd CPU full?
# 1  
Old 06-12-2009
Perl how to make the 2nd CPU full?

Hi Buddies,

my pc has two CPU, so CPU1 and CPU2.
I have a perl "a.pl", when i "./a.pl", i can see the CPU1 is full or CPU2 is full, mean only one is full, another one is idle.

Wonderring what shall i do in order to let both CPU to process this a.pl.Smilie

Thanks
# 2  
Old 06-12-2009
Use threads or fork into 2 processes each doing a part of the load. Both approaches will require you to somehow synchronize the workers (esp. any resources they access)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Deja-dup make my / full. So I cannot restore my back up

The problematic directory is the following: /root/.cache/deja-dup This directory grows until my "/" is full and then the restoring activity fails. I already tried to create a symbolic link with origin another partition where I have more space. However during the restoring activity ... (4 Replies)
Discussion started by: puertas12
4 Replies

2. Shell Programming and Scripting

Check if Queue empty or full in perl

Hi, I got problem with queue code how to determined empty and full and problem with while loop Here is my pseudo code : Input page Access Input Pgae Frame For i =3 to pageframe count by 1 construct queue of size i set pageFaultCount to 0 while morepages do page = NextPage... (1 Reply)
Discussion started by: guidely
1 Replies

3. Solaris

Solaris Volume Manager: Break Mirror and use to make a 2nd machine

Hello: I have a machine built on 2 drives and mirrors have been created to a second set of 2 drives (4 total) on the same platform. SVM. Might anyone provide guidance to create a second machine by breaking the mirrored set, moving the two mirrors (2) to another machine (same platform type),... (1 Reply)
Discussion started by: 4dailyrunner
1 Replies

4. UNIX for Advanced & Expert Users

how to make a full system backup excluding data and restoring it to a new system

Hi, In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way : - Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies

5. Shell Programming and Scripting

Return Full File Path To Array PERL

Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code; where $input=C:\test # change to and open the comparison directory chdir("$input2") || die "Cannot change dir: $!"; opendir(DIR2,... (2 Replies)
Discussion started by: cold_Que
2 Replies

6. Shell Programming and Scripting

Is there a way to make bash [or another shell] use all CPU cores to execute a single script?

I wrote a very simple script that matches combinations of alphabetic characters (1-5). I want to use it to test CPU speeds of different hardware/platforms. The problem is that on multi-core/processor systems, only one CPU is being utilized to execute the script. Is there a way to change that?... (16 Replies)
Discussion started by: ph0enix
16 Replies

7. Shell Programming and Scripting

Perl : Find a string and Print full line

Hi Need a perl script to read lines in a file, scan for a string named "APPLE" and write to different file the only lines containing the matched string. (5 Replies)
Discussion started by: PrasannaKS
5 Replies

8. Solaris

[problem]Make minimalis CPU and Memory Solaris 10

Dear All master We have Sunfire memory 16G memory and 8 Processor. I install with Solaris 10, but i think resource that use all proccess is very much, I installed this machine 3 times, twice install Oracle the load process make machine is very slow. in new install process like this,... (1 Reply)
Discussion started by: moslemovic
1 Replies

9. UNIX for Dummies Questions & Answers

How to Turn perl one-liners into full perl script?

I have the following command prompt perl one liner: perl -e 's/\(\)\\,\"]//g; s/^\s//g; s/;/\n/g' -pi result1 I tried to move this one liner into a perl script I am practicing with (just started learning perl right now). I tried the following (I only know how to open a file and output to a... (1 Reply)
Discussion started by: EDALBNUG
1 Replies

10. UNIX for Dummies Questions & Answers

Full usage of CPU

Hello all, I have a sunfire 280R with 2 750 MHz CPU and 2 Gig of RAM. But when I compile things it does not seem to be using all of it's resources thus the compile take forever. At most it seem to be only using at most 10% of CPU and 5% of swap sapce. I have tried to renice the pid of the... (6 Replies)
Discussion started by: larry
6 Replies
Login or Register to Ask a Question