Sponsored Content
Top Forums Programming MultiThreading using Pthreads Post 302380340 by Sastra on Monday 14th of December 2009 11:47:45 PM
Old 12-15-2009
"If Receive() does a lot of processing before actually altering or using the object members in any way, most of that could happen concurrently, but if all it does is update the object, almost nothing should happen concurrently, making the threads mostly pointless."

Can u please elaborate this point...
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

PThreads

Can anyone explain me how to use pthread_key_create() , pthread_setspecific(), pthread_getspecific() and pthread_key_delete () routines in pthreads. Kindly state by an example. (3 Replies)
Discussion started by: S.P.Prasad
3 Replies

2. Programming

pthreads

Does any one no of some good web site which will explain about how to program using pthreads in a UNIX enviroment? (6 Replies)
Discussion started by: fishman2001
6 Replies

3. Programming

pthreads

howcome that pthtreads spawn 2 extra processes? I'm kind of new with pthreads but fork() did not act like this. Anyone who can give me a technical explanation of what happends with mother / daughter processes? Best regards Esaia. (2 Replies)
Discussion started by: Esaia
2 Replies

4. Programming

PThreads

I have created a thread program, it is attached. My problem is that I need to loop this program multiple times, and basically reset everything including the threads created previously. I try to loop the program, the first run is fine, as always, but the second run of the program, the initialize... (0 Replies)
Discussion started by: justgotthis
0 Replies

5. HP-UX

pthreads

Hi! I'm linking my hpux code using -lpthread (gcc), yet it references libpthread_tr.1, the debug version of the pthread lib. How do I force it to use pthreads? Thanks, :) (3 Replies)
Discussion started by: zackz
3 Replies

6. Programming

multithreading on OSX

Hi all, I have a query about multithreading. What I would like to do is, at the start of my main update() function, start a couple of threads in parallel, once they are all complete carry on with my main update function. void update() { thread1->update(); // fluid solver ... (3 Replies)
Discussion started by: memoid
3 Replies

7. UNIX for Advanced & Expert Users

multithreading in UNIX

Hi, Can you please give me a suitable reference to learn multithreading programming in C in UNIX? Thanks (3 Replies)
Discussion started by: naan
3 Replies

8. Shell Programming and Scripting

Multithreading program

Hi I need to insert 1million records into MySQL database, but it is taking lot of time as there is no bulk insert support. I want to spawn 10 processes which will insert 100k records each parallely. Can somebody help me with a example program to execute this task through shell scripting. (5 Replies)
Discussion started by: sach_roger
5 Replies

9. Programming

Help with multithreading

I take this question of the The Linux Programming Interface: A Linux and Unix System Programming page 652 exercise 30.1 I want someone to explain the under line statement because it sounds complex to me couldn't understand anything 30-1 Modify the program (thread_incr.c) so that each loop in... (3 Replies)
Discussion started by: fwrlfo
3 Replies
PTHREAD_ATTR(3) 					   BSD Library Functions Manual 					   PTHREAD_ATTR(3)

NAME
pthread_attr_getstackaddr, pthread_attr_setstackaddr -- thread attribute operations SYNOPSIS
#include <pthread.h> int pthread_attr_getstackaddr(const pthread_attr_t *restrict attr, void **restrict stackaddr); int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr); DESCRIPTION
Thread attributes are used to specify parameters to pthread_create(). One attribute object can be used in multiple calls to pthread_create(), with or without modifications between calls. The functions pthread_attr_setstackaddr() and pthread_attr_getstackaddr() respectively, set and get the address at which the stack of the newly created thread should be located. The stackaddr attribute is set within the attr argument, which can subsequently be used as an argu- ment to pthread_create(). RETURN VALUES
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. pthread_attr_getstackaddr() returns the stackaddr attribute value in stackaddr if successful. ERRORS
pthread_attr_setstackaddr() will fail if: [EINVAL] Invalid value for attr. pthread_attr_getstackaddr() will fail if: [EINVAL] Invalid value for attr. SEE ALSO
pthread_create(3), pthread_attr_init(3), pthread_attr_setdetachstate(3), pthread_attr_setstacksize(3) STANDARDS
pthread_attr_setstackaddr(), pthread_attr_getstackaddr(), conform to ISO/IEC 9945-1:1996 (``POSIX.1'') BSD
December 31, 2007 BSD
All times are GMT -4. The time now is 04:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy