PThreads: question on basic problem (or POSIX Threads) Programming Software Development by jaeSun ok, I have an assignment ... it requires the use of pthreads .. i pretty much understand it, well, sorta .... the … number we compare and sort, we are to use pthreads for each set of 2 numbers ... anyone familiar with… you guys do ... anyways .... my question is, with pthreads, you have to create a PThread ID for each pthread… pthreads replacement? Programming Software Development by daviddoria Is pthreads still the way to go to detach a process from the main thread in linux? It seems seems kind of convoluted/old/c-style from looking at some examples - is there a more "c++" way? Thanks, Dave pthreads fatal error Programming Software Development by Danny_501 … all, I'm making a miltithreaded program that uses the pthreads library. One of the threads monitors the users input. my… Pthreads: Read/Write to files Programming Software Development by blackrobe Hey there, I'm having some difficulty understanding how pthreads are used for writing to files and reading from files … Pthreads not working on Netbeans using Cygwin Programming Software Development by blackrobe …. I'm having a problem running my program that uses pthreads, mutexes, and semaphores. After it creates 1 to 3-4… pthreads and posix semaphores Programming Software Development by dos_killer … programming and i am experiencing a bit of diffuclty with pthreads...basically the pthread_create() function in my code below i tend… pthreads server examples Programming Software Development by fg_aa_c … of any examples or tutorials for how to create a pthreads server? I have built a web server using fork() which… Re: pthreads scheduling problem? Programming Software Development by Salem … it specified that I need this? The manual pages for pthreads is a good bet. porting pthreads to win32 api Programming Software Development by stilllearning … have a question too .. I basically have a implementation of pthreads on Linux and I want to port it to Windows… how to do this, but I also came across the pthreads-win32 library. Would anyone recommend using it ? Since if I… OpenMP vs PThreads for linear programming Programming Software Development by arthurav The subject of my bachelour thesis is "Solving linear programming problems using parallel algorithms". I will create a library for solving different kinds of problems (simplex, branch and bound and so on). I want to use OpenMP or PThreads locally and OpenMPI in the network. Which one would you recommend for the case: OpenMP or Pthreads? Seg Fault! C++ pthreads In Linux Programming Software Development by John Linux …: [CODE]/****************************************************************************** * FILE: hello_arg1.c * DESCRIPTION: * A "hello world" Pthreads program which demonstrates one safe way * to pass arguments to… C++ linux pthreads Programming Software Development by FakeTales … to the same text file. I want to have two pthreads that will handle the printArray function and another pthread to… posix threads pthreads Programming Software Development by willyah Am a beginner in Pthread. How do I write a parallel program using posix threads pthreads (pthread.h) to calculate the time needed to calculate the dot product of two vectors using 1,2,4,8 threads. Re: pthreads and posix semaphores Programming Software Development by alexchen First, your code is not formatted. [url]http://www.gidnetwork.com/b-38.html[/url] [QUOTE]but i get a warning and an error.[/QUOTE] How does it failed? What type of error did you get? Re: pthreads and posix semaphores Programming Software Development by gerard4143 I cleaned your code up a little...well a lot [code] #include<pthread.h> #include<stdio.h> #include<sys/types.h> #include<semaphore.h> #include<unistd.h> pthread_t t1,t2; pthread_attr_t tattr; int counter; sem_t mutex; void* runner(void *arg) { int i = 0; printf("Thread received %i\n", *(int*)arg); for… Re: pthreads and posix semaphores Programming Software Development by dos_killer i understood my mistakes...thanks gerrard...although in your code... when starting a new thread the value of t passed is always 2 and never 1... where it should say Thread 1 started..it says Thread received 2 Thread received 2 instead of Thread received 1 Thread received 2 how is that ? Re: pthreads and posix semaphores Programming Software Development by gerard4143 [QUOTE=dos_killer;1461905]i understood my mistakes...thanks gerrard...although in your code... when starting a new thread the value of t passed is always 2 and never 1... where it should say Thread 1 started..it says Thread received 2 Thread received 2 instead of Thread received 1 Thread received 2 how is that ?[/QUOTE] Your passing … Re: pthreads server examples Programming Software Development by Ancient Dragon You may have to do a lot of recoding. [URL="http://gauss.ececs.uc.edu/Users/Franco/ForksThreads/forks.html"]Read this thread[/URL]. Re: compile pthreads in windows netbeans Programming Software Development by RajNOX … an error like this.... i dnt recompile the source of pthreads for making is static library..... [CODE]/bin/make -f nbproject… pthreads scheduling problem? Programming Software Development by clb2196 Hey guys, I'm new to C- I do Java- and for our OS class we're doing some basic code examples in C, on Linux. (Fedora core, if it matters). We're supposed to write a test program that shows the difference between how threads are run with round robin and fifo scheduling. I can't get the round robin implementation to work- I did some research and it … Re: OpenMP vs PThreads for linear programming Programming Software Development by pseudorandom21 I am familiar with neither, though I have used many a C++ library, and using only one or at the most two different libs will help maintain flexibility and minimize problems with the project. I would try to use only one, if possible. Re: OpenMP vs PThreads for linear programming Programming Software Development by arthurav Thank you. I will use only one of the SMP models but I don't know which one does fit better for the case. Re: Seg Fault! C++ pthreads In Linux Programming Software Development by ausrasul test is actually a pointer, you are sending a an address of an address, that give memory violation exception (seg fault) try: [CODE]rc = pthread_create(&thread1, NULL, Merge, (void *) test);[/CODE] see I removed the "&" from the container "test" Re: Seg Fault! C++ pthreads In Linux Programming Software Development by pseudorandom21 Just a suggestion since you're using C++, why not use templates instead of void pointers ? Re: C++ linux pthreads Programming Software Development by L7Sqr The signature of the function `pthread_create` expects to call is `void * function(void *)` and the fourth argument is a `void*` that is the argument passed to that function on thread creation. So, for example: void * printFunction(void * arg) { int * array = (int *)arg; // ... } int main () { int a[] = { 1, … Re: C++ linux pthreads Programming Software Development by FakeTales > The signature of the function pthread_create expects to call is void * function(void *) and the fourth argument is a void* that is the argument passed to that function on thread creation. So, for example: void * printFunction(void * arg) { int * array = (int *)arg; // ... } int main () {… Re: posix threads pthreads Programming Software Development by rubberman See my response to your previous post... :-( Visual Studio 2005 & POSIX threads Programming Software Development by nanodano …, and I found information on POSIX pthreads. Apparently, Visual Studio 2005 does not have [INLINECODE]pthreads.h[/INLINECODE] in their library. I…: [I] Win32 does not, and is unlikely to ever, support pthreads natively. This project seeks to provide a freely available and… Threads! Programming Software Development by n.aggel … the following questions: --- We are using pthreads and C. I think that i can use pthreads in c++ code but is there… in c++ ,in an object oriented manner? {Like object oriented pthreads} --- For everyone that has some experience with production code. Is… systemc simulation time problem Programming Software Development by mirfanud …programs written in pthread. so i have to interconnect the pthreads and systemc threads. The connection works fine, but I …want to calculate the execution time of the pthreads events in systemc simulation time. I use systemc events …to let it wait the pthreads part to forward some events and then notify the systemc…