Sponsored Content
Full Discussion: PThread and More Than 1 Core
Top Forums Programming PThread and More Than 1 Core Post 302219639 by ramen_noodle on Tuesday 29th of July 2008 06:11:45 PM
Old 07-29-2008
A pthread emulation package that is written to demonstrate 'thread like' behavior would only run uniprocessor in any case, right? I assume they are using some event mechanism for this emulation.

Use real threads for concurrency and smp is the easy answer, otherwise don't worry if
performance is acceptable I guess. My .02.
 

10 More Discussions You Might Find Interesting

1. Programming

More about Pthread

Can someone point to a link where I can get good info about pthread? thanx.. :) (1 Reply)
Discussion started by: jyotipg
1 Replies

2. Programming

pthread

consider if the thread routine returns any void pointer while calling pthread_join, the thread resources are freed and the thread will be terminated when the main thread is exit ,that is my assumption whether it is true how do we find whether the thread is alive or terminated how do we find... (0 Replies)
Discussion started by: MKSRaja
0 Replies

3. Programming

pthread.h

hallo 2 al can anyone pls tell me where and how can i find and install the pthread.h lib ? thx :cool: (2 Replies)
Discussion started by: XinU*
2 Replies

4. UNIX for Dummies Questions & Answers

Where are the pthread functions??

When I use some of the pthread functions: pthread_join, pthread_exit they work perfect. But when I look in the pthread.h file I can't seem to find any implementations of the functions...where are they hiding?? (2 Replies)
Discussion started by: bigblop
2 Replies

5. UNIX for Dummies Questions & Answers

difference between Dual-core & Core-to-duo

Can anybody tell What is the exact difference between a Dual-core processor and a Core-to-duo processor ?Advance thanks to all my friends. (1 Reply)
Discussion started by: Ajith kumar.G
1 Replies

6. Programming

Error with Pthread

problem solved edited, sorry (1 Reply)
Discussion started by: joey
1 Replies

7. Programming

How can I parallize using pthread

Hi all, How can i parallize this code in pthread? for(round=1;round<=16;round++) { Expansion(mid, 17 - round - 1, left); Expansion(mid, round - 1, right); round++; Expansion(right, 17 - round - 1, mid); Expansion(left, round - 1,mid); } Whereby each loop depend on the... (2 Replies)
Discussion started by: m_enayah
2 Replies

8. UNIX for Advanced & Expert Users

pthread

I am so confused about the user threads and kernel threads.Suppose I created a thread using pthread create call in Linux ,whether it will be a user thread or kernel thread.If it user thread,then how its map to kernel thread. I heard about the M:1,M:N,1:1 mapping methods.Which method linux is... (1 Reply)
Discussion started by: sujith4u87
1 Replies

9. Programming

Help with pthread error

I have written a C code and when i compile it there are 0 warnings and 0 errors, but when i try to run apears: ./client: symbol lookup error: ./client: undefined symbol: pthread_create, version GLIBC_2.1 the part of the code where i have the pthread_creat is: int serverConection(int... (5 Replies)
Discussion started by: SuperStout
5 Replies

10. Programming

pthread()

I have a while loop like so: while (counter (file1)); how can I pass that into a pthread_create()? I was thinking ... while(pthread_create(&path, NULL, counter, file)); is that right? (1 Reply)
Discussion started by: l flipboi l
1 Replies
sched_yield(3)						     Library Functions Manual						    sched_yield(3)

NAME
sched_yield - Signals scheduler a willingness to yield to another thread. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> void sched_yield(void); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: IEEE Std 1003.1c-1995, POSIX System Application Program Interface PARAMETERS
None DESCRIPTION
This routine forces the running thread to relinquish the processor until it again becomes the head of its thread list. This routine noti- fies the thread scheduler that the current thread is willing to release its processor to other threads of equivalent or greater scheduling precedence. (A thread generally will release its processor to a thread of a greater scheduling precedence without calling this routine.) If no other threads of equivalent or greater scheduling precedence are ready to execute, the thread continues. This routine can allow knowledge of the details of an application to be used to improve its performance. If a thread does not call sched_yield, other threads may be given the opportunity to run at arbitrary points (possibly even when the interrupted thread holds a required resource). By making strategic calls to sched_yield, other threads can be given the opportunity to run when the resources are free. This can sometimes improve performance by reducing contention for the resource. As a general guideline, consider calling this routine after a thread has released a resource (such as a mutex) that is heavily contended for by other threads. This can be especially important if the program is running on a uniprocessor machine, or if the thread acquires and releases the resource inside a tight loop. Use this routine carefully and sparingly, because misuse can cause unnecessary context switching which will increase overhead and degrade performance. For example, it is counter-productive for a thread to yield while it holds a resource that the threads to which it is yielding will need. Likewise, it is pointless to yield unless there is likely to be another thread that is ready to run. RETURN VALUES
None RELATED INFORMATION
Functions: pthread_attr_setschedparam(3), pthread_setschedparam(3) Manuals: Guide to DECthreads and Programmer's Guide delim off sched_yield(3)
All times are GMT -4. The time now is 08:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy