Sponsored Content
Top Forums Programming Multi thread data sharing problem in uclinux Post 302397716 by mrhosseini on Tuesday 23rd of February 2010 02:01:51 AM
Old 02-23-2010
thanks,

Quote:
You should really be using mutexes, though.
yes, that was just an example that i used to test the threads behavior.

so the mutexes and any other data that i want to be shared must be defined as volatile, am i right?
This User Gave Thanks to mrhosseini For This Post:
 

8 More Discussions You Might Find Interesting

1. Programming

Multi threading using posix thread library

hi all, can anyone tell me some good site for the mutithreading tutorials, its application, and some code examples. -sushil (2 Replies)
Discussion started by: shushilmore
2 Replies

2. UNIX for Advanced & Expert Users

mmap vs shared memory - which is best for sharing data between applications?

Between mmap and shared memory which is the best method of sharing data between multiple applications, interms of speed? (2 Replies)
Discussion started by: nmds
2 Replies

3. Programming

forking. sharing global data in childs

hi, i want to write a code for forking 3 4 child. n wants that every child process one of the account from global account list. i wrote a program for that, but problem is every child is processing every account in list. what can me done to avoid it. attaching code with it #include <stdio.h>... (2 Replies)
Discussion started by: anup13
2 Replies

4. Solaris

Windows/Solaris data sharing

Hi all, I have a request from Developer team in my compagny, they would like to be able to share data between unix and windows world. 1. We would like to be able to see Unix data from Windows : ?Samba ? 2 We would like to be able to see windows data from Solaris (Mount point) : ?NFS server... (4 Replies)
Discussion started by: unclefab
4 Replies

5. Shell Programming and Scripting

data sharing between process

hi ! i want to make 2 c prog such tht if i give an input in 1st prog then i can use tht input in 2nd. so over all i want to do data sharing between process using files. plz give me suggestions how can i achieve this ? thanks ya! (2 Replies)
Discussion started by: Sgupta
2 Replies

6. Shell Programming and Scripting

Multi thread shell programming

I have a unix directory where a million of small text files getting accumulated every week. As of now there is a shell batch program in place which merges all the files in this directory into a single file and ftp to other system. Previously the volume of the files would be around 1 lakh... (2 Replies)
Discussion started by: vk39221
2 Replies

7. UNIX for Dummies Questions & Answers

Cross-compiling libiconv for uclinux

Hi everyone, I want to cross-compile libiconv for uclinux to create a static library. I use the following command : ./configure --enable-static --disable-shared --build=i686-pc-linux-gnu --host=nios2-unknown-linux-gnu --prefix=/home/captain/Programs/nios2-linux/uClinux-dist/staging/usr... (2 Replies)
Discussion started by: moganesh
2 Replies

8. Shell Programming and Scripting

Multi thread awk command for faster performance

Hi, I have a script below for extracting xml from a file. for i in *.txt do echo $i awk '/<.*/ , /.*<\/.*>/' "$i" | tr -d '\n' echo -ne '\n' done . I read about using multi threading to speed up the script. I do not know much about it but read it on this forum. Is it a... (21 Replies)
Discussion started by: chetan.c
21 Replies
libcurl-thread(3)					       libcurl thread safety						 libcurl-thread(3)

NAME
libcurl-thread - libcurl thread safety Multi-threading with libcurl libcurl is thread safe but has no internal thread synchronization. You may have to provide your own locking should you meet any of the thread safety exceptions below. Handles. You must never share the same handle in multiple threads. You can pass the handles around among threads, but you must never use a single handle from more than one thread at any given time. Shared objects. You can share certain data between multiple handles by using the share interface but you must provide your own locking and set curl_share_setopt(3) CURLSHOPT_LOCKFUNC and CURLSHOPT_UNLOCKFUNC. TLS
If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are then of course using the underlying SSL library multi-threaded and those libs might have their own requirements on this issue. You may need to provide one or two functions to allow it to function prop- erly: OpenSSL OpenSSL 1.1.0 "can be safely used in multi-threaded applications provided that support for the underlying OS threading API is built- in." https://www.openssl.org/docs/manmaster/crypto/threads.html#DESCRIPTION OpenSSL <= 1.0.2 the user must set callbacks. https://www.openssl.org/docs/man1.0.2/crypto/threads.html#DESCRIPTION https://curl.haxx.se/libcurl/c/opensslthreadlock.html GnuTLS http://gnutls.org/manual/html_node/Thread-safety.html NSS thread-safe already without anything required. PolarSSL Required actions unknown. yassl Required actions unknown. axTLS Required actions unknown. Secure-Transport The engine is used by libcurl in a way that is fully thread-safe. WinSSL The engine is used by libcurl in a way that is fully thread-safe. wolfSSL The engine is used by libcurl in a way that is fully thread-safe. BoringSSL The engine is used by libcurl in a way that is fully thread-safe. Other areas of caution Signals Signals are used for timing out name resolves (during DNS lookup) - when built without using either the c-ares or threaded resolver backends. When using multiple threads you should set the CURLOPT_NOSIGNAL(3) option to 1L for all handles. Everything will or might work fine except that timeouts are not honored during the DNS lookup - which you can work around by building libcurl with c-ares or threaded-resolver support. c-ares is a library that provides asynchronous name resolves. On some platforms, libcurl simply will not function properly multi-threaded unless the CURLOPT_NOSIGNAL(3) option is set. Name resolving gethostby* functions and other system calls. These functions, provided by your operating system, must be thread safe. It is very important that libcurl can find and use thread safe versions of these and other system calls, as otherwise it can't function fully thread safe. Some operating systems are known to have faulty thread implementations. We have previously received problem reports on *BSD (at least in the past, they may be working fine these days). Some operating systems that are known to have solid and working thread support are Linux, Solaris and Windows. curl_global_* functions These functions are not thread safe. If you are using libcurl with multiple threads it is especially important that before use you call curl_global_init(3) or curl_global_init_mem(3) to explicitly initialize the library and its dependents, rather than rely on the "lazy" fail-safe initialization that takes place the first time curl_easy_init(3) is called. For an in-depth explanation refer to libcurl(3) section GLOBAL CONSTANTS. Memory functions These functions, provided either by your operating system or your own replacements, must be thread safe. You can use curl_global_init_mem(3) to set your own replacement memory functions. Non-safe functions CURLOPT_DNS_USE_GLOBAL_CACHE(3) is not thread-safe. libcurl 7.54.0 April 10, 2017 libcurl-thread(3)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy