05-14-2008
Multithread app - Read-Only Data
Hello,
I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding...
Thanks
10 More Discussions You Might Find Interesting
1. Programming
I wrote a server which creates a thread for every client connection. I have to include timeout function that will kill the server thread if the client doesn't respond for specific time. That too using signal(SIGALRM). For this i am using alarm() function.
When the server thread detects signal it... (1 Reply)
Discussion started by: Nads
1 Replies
2. Programming
Hi
i m codding a programm,it can download any packet from ftp,I use libcurl library. But i want to use threads for downloading.(Multithreading).i cant get ftp file size from ftp and divide packet small pieces,like threads use.
Please share your experince with me ,thanks. (0 Replies)
Discussion started by: canerbulut
0 Replies
3. UNIX for Advanced & Expert Users
I have 3 columns in an excel sheet.
c1 c2 c3
EIP_ACCOUNT SMALL_TS_01 select A.* from acc;
All the above 3 col shoud be passed a variable in the unix code.
1.How to read an excel file
2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies
4. Programming
Hi all,i'm new on this forum, excuse me for my english.
I have wrote a server that accept connection from multiple client with the fork,but every client had to insert data in a linear list.
The problem is that every client insert data in an own copy of the linear list and this is caused by... (7 Replies)
Discussion started by: kemistry
7 Replies
5. Programming
Hello. I can't get it work :(
My application receives data from em-marin reader only being active. Switching to another app makes the port become silent.
MarinReader works in another thread.
Port reading is going while the app is inactive (tested).
Env: Ubuntu 9.04, Gnome, Qt (i've tryed pure... (2 Replies)
Discussion started by: Dp0H
2 Replies
6. Programming
Hi.
I plan to build an application which takes text data from a user.
It then sends this to a website, login required.
The business case being this site contains many text fields, mostly redundant to user. My application would only prompt user for necessary text.
What language, methods... (4 Replies)
Discussion started by: cic
4 Replies
7. Red Hat
I am currently have Centos 5.5 which consumes more CPU waiting for Kcrypt process. Later came to know that kcrypt is single threaded and hence consumes one CPU, results in performance degradation.
Does any one really knows/practically experimented multithread of Kcryptd process with any of... (1 Reply)
Discussion started by: ragavendraganes
1 Replies
8. Cybersecurity
What is the best practice to allow a 3rd party health monitoring app to read the messages file. Since messages is a system file and is owned by root the app cannot read the file. I don't want to run the app as root so how should I allow the app to read the file. The read function is actually built... (2 Replies)
Discussion started by: slwiley
2 Replies
9. Shell Programming and Scripting
We have the data looks like below in a log file.
I want to generat files based on the string between two hash(#) symbol like below
Source:
#ext1#test1.tale2 drop
#ext1#test11.tale21 drop
#ext1#test123.tale21 drop
#ext2#test1.tale21 drop
#ext2#test12.tale21 drop
#ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
10. Programming
With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here:
ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages
The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
LEARN ABOUT HPUX
pthread_mutex_unlock
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)