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
pthread_mutex_unlock(3T)												  pthread_mutex_unlock(3T)

NAME
pthread_mutex_unlock() - unlock a mutex. SYNOPSIS
PARAMETERS
mutex Pointer to the mutex to be unlocked. DESCRIPTION
The function is called by the owner of the mutex referenced by mutex to unlock the mutex. The manner in that the mutex is released is dependent upon the mutex's type attribute. For normal and default mutexes, undefined behavior will result if is called on an unlocked mutex or by a thread that is not the current owner. For recursive and error-checking mutexes, an error is returned if is called on an unlocked mutex or by a thread which is not the current owner. For recursive mutexes, the owner must call as many times as the mutex was locked before another thread can lock the mutex. If there are threads blocked on the mutex referenced by mutex when releases the mutex, the scheduling policy is used to determine which thread will acquire the mutex next. RETURN VALUE
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
For each of the following conditions, if the condition is detected, the function returns the corresponding error number: [EINVAL] mutex is not an initialized mutex. [EPERM] The calling thread does not own mutex. On HP-UX, this error is not detected for or mutexes. [EFAULT] mutex parameter points to an illegal address. AUTHOR
was derived from the IEEE POSIX P1003.1c standard and HP extensions. SEE ALSO
pthread_mutex_init(3T), pthread_mutex_destroy(3T), pthread_mutex_lock(3T), pthread_mutex_trylock(3T). STANDARDS CONFORMANCE
Pthread Library pthread_mutex_unlock(3T)
All times are GMT -4. The time now is 02:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy