Pthreads (POSIX Threads) is a standardised C-based API for creating and manipulating threads on a POSIX-compliant system. It is defined by the standard "POSIX.1c, Threads extensions (IEEE Std 1003.1c-1995)", and subsequently by the Single Unix Specification.
1
vote
1answer
13 views
C++ pthread synchronization and multiple wake up for thread
a question about C++ thread synchronization.
We suppose that have 2 pthreads: Thread1 and Thread2.
Thread1 is engaged in its task and, in some cases, he must notify the update of the state to the ...
-1
votes
0answers
24 views
effect of sleep(1) after pthread_join()?
I have a question.
Why use sleep(1) function after pthread_join() ??
Pthread_join alone is not enough??
I have tried using pthread join without sleep() in some open source code but it resulted in ...
1
vote
1answer
22 views
Threaded low latency audio on Android
The short version:
I'm developing a synth app and using Opensl with low latency. I was doing all the audio calculation in the Opensl callback funktion (I know I should not but I did anyway). Now the ...
0
votes
4answers
59 views
How to access a private member inside a static void* function
File:Service.hpp
class Service
{
private:
boost::unordered_map<std::string,int> m_mapModuleType2FD;
void ProcessRequest();
public:
static void* KeepAlive(void* arg);
...
0
votes
0answers
16 views
how to change the scope of an thread in linux?
i am trying to create an program which sets the scope of an POSIX thread in linux .. I am using pthread_attr_setscope() for setting the scope of the thread to process context but it is set to default ...
0
votes
0answers
5 views
Is there any way we can add new parameters to apache benchmark
Is there any way we can add new parameters to apache bench like a parameter which would mask the specific CPU cores and only specified cores would be loaded to handle the request and another parameter ...
3
votes
1answer
39 views
How to copy pthread_attr_t?
I guess using memcpy to copy pthread_attr_t isn't a good idea as the struct seems private on both Darwin and Linux. What the proper way of copying pthread_attr_t? There isn't a copy function in ...
0
votes
2answers
39 views
accept a connection inside a pthread
I hope someone can help me with my problem.
I trying to make a client/server FTP application using C,
my program implementation is like this :
main()
{
1)create socket
2)bind on port 8888
3)listen
...
1
vote
1answer
34 views
On what systems sleep() is not a pthread cancellation point?
pthread_cancel() successfully interrupts sleep() on Solaris 10, Linux and Cygwin.
So why people use pthread_cond_timedwait() instead of sleep()?
In the following example PPBsleep() is the function I ...
0
votes
0answers
25 views
When was the threading implemented in unix? [migrated]
Which is the first Unix version or Linux version which implemented threads. And in which version bound and unbound threads were implemented? I know that in current Linux version threads are unbound by ...
0
votes
1answer
22 views
Installing pThreads in Windows
Can anyone guide me in installing pThreads in Windows .
Actually i want to enable Threads in PHP .
require_once( 'Thread.php' );
// test to see if threading is available
if( ! Thread::available() ...
0
votes
1answer
37 views
Segmentation Fault or SizeOf not used correctly
So I am working on a program where I am using pthreads to solve a problem in parallel. Right now, I am getting a seg fault when I run the following code in the function: average_power.
This is the ...
0
votes
1answer
35 views
Using semaphore for multithreading in C
The Idea here is to create a file to be written to. I'm trying to create ten threads and have them print to the file 10 times each. Using a semaphore to stop multiple threads from writing to the file ...
0
votes
0answers
11 views
repeat downloading and showing image
hi mates im Aymen and im trying to make android application who download pics from ftp server token by webcam and show every downloaded pic in the imageview
the problem is that i wanna repeat the ...
1
vote
1answer
41 views
Is it needed to detach pthread to prevent memory leaks?
In my programme, I handle new threads with
pthread_t thread;
pthread_create(&thread, NULL,
c->someFunction, (void *) fd); //where fd is ID of the thread
The question is quite ...