Sponsored Content
Top Forums Programming C POSIX: Analyze a Boggle board using 100% CPU on a quad core. Post 302358513 by HeavyJ on Friday 2nd of October 2009 07:55:28 PM
Old 10-02-2009
Allow me to make myself very clear:

- The lexicon data structure is immutable.
- I have named it the ADTDAWG - Adamovsky Direct Tracking Directed Acyclic Word Graph, contained in 4 arrays of basic number types.
- The character set I have chosen is 14 of the best English letters.
- There is a thread that is responsible for words that begin with each of the letters in the character set.
- The threads all call the same recursive word-discovery function, and then modify a set of global time-stamps to eliminate the duplicate word problem.
- They will never try to modify the same time-stamp because they are responsible for a different subset of the lexicon.

- I used mutexes, and condition variables to communicate when work on the current board should begin, and when it has finished.

- My question is this - Do POSIX multi-threads really allow for an optimal implementation of a micro-parallel algorithm? Or am I doing something wrong, because I am only using 45% of the power of my Quad-Core, when I should be maxing it out?

Do you really want to look at the code that I wrote? At this point, I have every reason to believe that it will introduce mass confusion. It is well written, but it requires an in-depth knowledge of lexicon data structure optimization.

So you suggest that each core has a private cache? I would love to see a block diagram of how the Core2 layout works, so that I could stop spinning my wheels on this problem.

A single thread can score 1277 of the best 23 boards found to date, each with a score around 10769 points for the TWL06 lexicon.

That means that the recursive function is being called many, many, many times per second. Should this fact be a concern?
 

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. 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

3. 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

4. Linux Benchmarks

AMD Phenom(tm) 9950 Quad-Core Processor, Ram: 3.6 GB, Foxconn 7da-s and Linux 2.6.26-2-amd64

CPU/Speed: AMD Phenom(tm) 9950 Quad-Core Processor Ram: 3.6 GB Motherboard: Foxconn 7da-s Bus: Cache: Controller: Disk: Load: Kernel: Linux 2.6.26-2-amd64 Kernel ELF?: pgms: ============================================================== BYTE UNIX Benchmarks (Version... (0 Replies)
Discussion started by: migracho
0 Replies

5. 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

6. Solaris

Share CPU core

Hi, I have 2 physical processor UltraSPARC-T2 with 32 virtual processors I want to execute a perl program on 10 virtual processors. I try prset command, but I don't see a difference. psrset -c "created processor set 2" 1 2 3 4 5 6 7 8 9 10" psrset -b 2 `pgrep program.pl` Maybe... (8 Replies)
Discussion started by: falloutsam
8 Replies

7. HP-UX

how can i know this processor quad or dual core ?

hi every body i want to know if i have server with hp-ux os if i did "machinfo" i will see no of cpu = for example 16 how can i know this is dual or quad core . thanks (2 Replies)
Discussion started by: maxim42
2 Replies

8. Solaris

does a cpu/memory board have a firmware ??

please help does a cpu/memory module have a firmware ?? and do i need to check it before install the cpu/memory module in the motherboard ?? thnx (2 Replies)
Discussion started by: bahjatm
2 Replies

9. 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
Log::Report::Extract::PerlPPI(3pm)			User Contributed Perl Documentation			Log::Report::Extract::PerlPPI(3pm)

NAME
Log::Report::Extract::PerlPPI - Collect translatable strings from Perl using PPI SYNOPSIS
my $ppi = Log::Report::Extract::PerlPPI->new ( lexicon => '/usr/share/locale' ); $ppi->process('lib/My/Pkg.pm'); # many times $ppi->showStats; # to dispatchers which accept TRACE or INFO $ppi->write; # also cleans processing memory. DESCRIPTION
This module helps maintaining the POT files, updating the list of message-ids which are kept in them. After initiation, the process() method needs to be called with all files which changed since last processing and the existing PO files will get updated accordingly. If no translations exist yet, one "textdomain/xx.po" file will be created. METHODS
Constructors Log::Report::Extract::PerlPPI->new(OPTIONS) -Option --Default charset 'utf-8' lexicon <required> charset => STRING The character-set used in the PO files. lexicon => DIRECTORY The place where the lexicon is kept. When no lexicon is defined yet, this will be the directory where an "domain/xx.po" file will be created. Accessors $obj->charset Returns the character-set used inside the POT files. $obj->domains Returns a sorted list of all known domain names. $obj->index Returns the Log::Report::Lexicon::Index object, which is listing the files in the lexicon directory tree. Processors $obj->process(FILENAME, OPTIONS) Update the domains mentioned in the FILENAME. All textdomains defined in the file will get updated automatically, but not written before all files where processed. -Option --Default charset 'iso-8859-1' charset => STRING $obj->showStats([DOMAINs]) Show a status about the DOMAIN (by default all domains). At least mode verbose is required to see this. $obj->write([DOMAIN]) Update the information of the files related to DOMAIN, by default all processed DOMAINS. All information known about the DOMAIN is removed from the cache. SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Extract::PerlPPI(3pm)
All times are GMT -4. The time now is 11:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy