I want to publish my PHP Extension in PECL
| From: | China 陈毓端 | Date: | Fri, 08 Aug 2014 13:14:02 +0000 |
| Subject: | I want to publish my PHP Extension in PECL | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-12156@lists.php.net to get a copy of this message | ||
> Are you sure about that? Or do you refer to "libhdfs can be used in
> threaded applications using the Posix Threads" from their doc? Which
> means something different (libhdfs is thread safe, given that the
> global functions are called correctly.).
libdhfs is thread safe.
Concurrency and Hadoop FS "handles"
The Hadoop FS implementation includes a FS handle cache which caches based on the URI of the
namenode along with the user connecting. So, all calls to hdfsConnect will return the same handle
but calls to hdfsConnectAsUser with different users will return different handles. But, since HDFS
client handles are completely thread safe, this has no bearing on concurrency.
Concurrency and libhdfs/JNI
The libhdfs calls to JNI should always be creating thread local storage, so (in theory), libhdfs
should be as thread safe as the underlying calls to the Hadoop FS.
http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/LibHdfs.html