search for: pthread_cond_t

Displaying 20 results from an estimated 33 matches for "pthread_cond_t".

2011 Nov 11
1
[RFC] kvm tools: Implement multiple VQ for virtio-net
...E 0 -#define VIRTIO_NET_TX_QUEUE 1 +#define VIRTIO_NET_NUM_QUEUES 16 +#define VIRTIO_NET_IS_RX_QUEUE(x) (((x) % 2) == 0) struct net_dev; @@ -49,14 +48,13 @@ struct net_dev { struct virtio_net_config config; u32 features; - pthread_t io_rx_thread; - pthread_mutex_t io_rx_lock; - pthread_cond_t io_rx_cond; - - pthread_t io_tx_thread; - pthread_mutex_t io_tx_lock; - pthread_cond_t io_tx_cond; + pthread_t io_thread[VIRTIO_NET_NUM_QUEUES]; + pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES]; + pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES]; + int rx_vq_num; + int tx_vq_num;...
2011 Nov 11
1
[RFC] kvm tools: Implement multiple VQ for virtio-net
...E 0 -#define VIRTIO_NET_TX_QUEUE 1 +#define VIRTIO_NET_NUM_QUEUES 16 +#define VIRTIO_NET_IS_RX_QUEUE(x) (((x) % 2) == 0) struct net_dev; @@ -49,14 +48,13 @@ struct net_dev { struct virtio_net_config config; u32 features; - pthread_t io_rx_thread; - pthread_mutex_t io_rx_lock; - pthread_cond_t io_rx_cond; - - pthread_t io_tx_thread; - pthread_mutex_t io_tx_lock; - pthread_cond_t io_tx_cond; + pthread_t io_thread[VIRTIO_NET_NUM_QUEUES]; + pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES]; + pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES]; + int rx_vq_num; + int tx_vq_num;...
2008 Nov 04
2
[LLVMdev] cross compiling using llvm 1.8
...ke[2]: Entering directory `/c/llvm1.8/generated-llvm/obj/examples/ParallelJIT' llvm[2]: Compiling ParallelJIT.cpp for Debug build c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:20:21: pthread.h: No such file or directory c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:212: error: `pthread_cond_t ' does not name a type ../../llvm/configure --prefix=/c/llvm1.8/generated-llvm/install/ --enable-debug-runtime --enable-jit Is there an elegant way to skip building the examples (e.g. via a specific flag of cofigure) or the only way to overcome this is to insert #if 0 in the actual code?...
2012 Aug 31
2
[LLVMdev] Clang incompatible with GCC on Linux + ARM Cortex-A9
...tible with GCC. My program works fine while compiled using GCC but will crash with Clang. Specifically, the alignment strategy of Clang confused me. I wrote a small program to print the structure layout of the following and compiled it with both Clang and GCC. struct S { pthread_mutex_t mutex; pthread_cond_t cond; int32_t int32_1; int32_t int32_2; }; The output are as following (the format is: field_address (+offset): field_name; field_size): gcc 0xbe92d588 (+0) : mutex ; 24 0xbe92d5a0 (+24): cond ; 48 0xbe92d5d0 (+72): int32_1 ; 4 0xbe92d5d4 (+76): int32_2 ; 4 clang 0xbe856580 (+0) : mutex ;...
2006 Nov 28
0
[LLVMdev] mingw binary is corrupt
...toLLVM (without symbols) make[2]: Leaving directory `/d/Apps/llvm/examples/BFtoLLVM' make[2]: Entering directory `/d/Apps/llvm/examples/ParallelJIT' llvm[2]: Compiling ParallelJIT.cpp for Release build ParallelJIT.cpp:20:21: pthread.h: No such file or directory ParallelJIT.cpp:212: error: `pthread_cond_t' does not name a type ParallelJIT.cpp:212: error: extra semicolon ParallelJIT.cpp:213: error: `pthread_mutex_t' does not name a type ParallelJIT.cpp:213: error: extra semicolon .... lots more errors pthread.h does not exist anywhere in the llvm directory so it must assume that it's a s...
2009 Mar 18
3
[LLVMdev] Status of LLVM's atomic intrinsics
...llect2: ld returned 1 exit status The source is: #include <pthread.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #define NUM_THREADS 9 #define TCOUNT (1 << 23) #define COUNT_LIMIT (1 << 25) volatile int count = 0; pthread_mutex_t count_mutex; pthread_cond_t count_threshold_cv; void *inc_count(void *t) { int j,i; double result=0.0; long my_id = (long)t; for (i=0; i<TCOUNT; i++) { //void *data = malloc(1); int count2 = __sync_add_and_fetch(&count, 1); /* Check the value of count and signal waiting thread when conditio...
2006 Nov 27
2
[LLVMdev] mingw binary is corrupt
On Sun, 2006-11-26 at 19:04 -0800, SevenThunders wrote: > Here is how it fails now: > > make[2]: Entering directory `/d/Apps/llvm/tools/llvm-config' > make[2]: Nothing to be done for `all'. > make[2]: Leaving directory `/d/Apps/llvm/tools/llvm-config' > The system cannot find the path specified. > make[2]: Entering directory `/d/Apps/llvm/tools/opt' >
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
..._rwlock_t lockarray[CURL_LOCK_DATA_LAST]; + +/* Curl share data. */ +static CURLSH *share; /* This lock protects access to the curl_handles vector below. */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; @@ -90,18 +103,46 @@ static curl_handle_list curl_handles = empty_vector; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; static size_t in_use = 0, waiting = 0; -/* Close and free all handles in the pool. */ +/* Initialize pool structures. */ void -free_all_handles (void) +load_pool (void) { size_t i; + for (i = 0; i < ARRAY_SIZE (lockarray); ++i) + pthread_rwlock_init...
2008 Nov 04
0
[LLVMdev] cross compiling using llvm 1.8
Aviv Peretz wrote: > > Hi, > > > I finally gave up building on Linux, in the meantime, and tried to > build this version straight on Windows, using mingw32. > > > .... > > appending configuration tag CXX to mklib > appending configuration tag F77 to mklib > checking for llvm-gcc.exe... /c/llvm1.8-mingw32/bin/llvm-gcc.exe > checking for llvm-g++.exe...
2009 Mar 18
0
[LLVMdev] Status of LLVM's atomic intrinsics
...lude <pthread.h> > #include <unistd.h> > #include <stdio.h> > #include <stdlib.h> > > #define NUM_THREADS 9 > #define TCOUNT (1 << 23) > #define COUNT_LIMIT (1 << 25) > > volatile int count = 0; > pthread_mutex_t count_mutex; > pthread_cond_t count_threshold_cv; > > void *inc_count(void *t) > { > int j,i; > double result=0.0; > long my_id = (long)t; > > for (i=0; i<TCOUNT; i++) { > //void *data = malloc(1); > int count2 = __sync_add_and_fetch(&count, 1); > > /* >...
2023 Feb 22
2
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
I'm mainly posting this to the list as a back-up. It does work, it does _not_ improve performance in any noticable way. However I'm having lots of trouble getting HTTP/2 to work (with or without this patch) and that's stopping me from testing anything properly. Rich.
2008 Nov 04
2
[LLVMdev] cross compiling using llvm 1.8
Hi, I finally gave up building on Linux, in the meantime, and tried to build this version straight on Windows, using mingw32. This is my command line: (running from /c/llvm1.8/generated-llvm/obj) *../../llvm/configure --prefix=/c/llvm1.8/gene* *rated-llvm/install/ --enable-debug-runtime --enable-jit* This is my path definition (it has several redundancies): $ echo $PATH
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...; > + > +/* Curl share data. */ > +static CURLSH *share; > > /* This lock protects access to the curl_handles vector below. */ > static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; > @@ -90,18 +103,46 @@ static curl_handle_list curl_handles = empty_vector; > static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; > static size_t in_use = 0, waiting = 0; > > -/* Close and free all handles in the pool. */ > +/* Initialize pool structures. */ > void > -free_all_handles (void) > +load_pool (void) > { > size_t i; > > + for (i = 0; i &lt...
2019 Oct 10
1
[PATCH NOT WORKING nbdkit] vddk: Restructure plugin to allow greater parallelism.
We had a query yesterday about the VDDK plugin and making it actually obey the weird "Multithreading Considerations" rules in the VDDK documentation (https://vdc-download.vmware.com/vmwb-repository/dcr-public/8f96698a-0e7b-4d67-bb6c-d18a1d101540/ef536a47-27cd-481a-90ef-76b38e75353c/vsphere-vddk-671-programming-guide.pdf) This patch is my attempt to implement this. The idea is that the
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
This fixes the long-standing crash on close when nbdkit exits. I did try first to fix threads so we're using a proper thread pool, but that's difficult to implement. So this does the minimal change needed to fix the crash instead. There are still two segfaults that happen during running the test suite. One is deliberately caused (tests/test-captive.sh). The other appears to be an
2020 Aug 06
5
[PATCH nbdkit NOT WORKING 0/2] vddk: Relax threading model.
I believe this roughly implements Nir's proposal here: https://www.redhat.com/archives/libguestfs/2020-August/msg00028.html Unfortunately it doesn't work for me. It actually slows things down quite a lot, for reasons I don't understand. Note the adjustment of the pool-max parameter and how it affects the total time. The results are quite reproducible. $ ./nbdkit -r -U - vddk
2020 Aug 06
0
[PATCH nbdkit 2/2] vddk: Relax thread model to PARALLEL and implement a disk handle pool.
...y; /* readonly flag for this connection */ + uint32_t flags; /* open flags */ + + /* Pool of VDDK disk handles. Do not access this directly, use + * GET_VDDK_HANDLE_FOR_CURRENT_SCOPE macro to get a free handle. + */ + pthread_mutex_t vddk_handles_lock; + pthread_cond_t vddk_handles_cond; + vddk_handles vddk_handles; }; static inline VixDiskLibConnectParams * @@ -531,17 +556,28 @@ free_connect_params (VixDiskLibConnectParams *params) static void * vddk_open (int readonly) { - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&open_close_lock); - struct vddk_handle *h;...
2019 Jun 04
0
[PATCH libnbd v2 4/4] examples: Add concurrent writer example.
...ead (one per libnbd handle). */ +struct writer_data { + size_t i; /* Thread index, 0 .. NR_MULTI_CONN-1 */ + struct nbd_handle *nbd; /* NBD handle. */ + struct queue *q, *q_end; /* Queue of items to write. */ + pthread_mutex_t q_lock; /* Lock on queue. */ + pthread_cond_t q_cond; /* Condition on queue. */ +}; + +static void *start_writer_thread (void *arg); +static int writer (void *data, const void *buf, size_t len); + +static void * +start_reader_thread (void *arg) +{ + struct nbd_handle *nbd; + struct pollfd fds[1]; + struct thread_status *status = arg;...
2019 Jun 03
0
[PATCH libnbd discussion only 5/5] examples: Add concurrent writer example.
...ead (one per libnbd handle). */ +struct writer_data { + size_t i; /* Thread index, 0 .. NR_MULTI_CONN-1 */ + struct nbd_handle *nbd; /* NBD handle. */ + struct queue *q, *q_end; /* Queue of items to write. */ + pthread_mutex_t q_lock; /* Lock on queue. */ + pthread_cond_t q_cond; /* Condition on queue. */ +}; + +static void *start_writer_thread (void *arg); +static void writer (void *data, const void *buf, size_t len); + +static void * +start_reader_thread (void *arg) +{ + struct nbd_handle *nbd; + struct pollfd fds[1]; + struct reader_status *status = arg...
2020 Aug 06
3
Re: [PATCH nbdkit 2/2] vddk: Relax thread model to PARALLEL and implement a disk handle pool.
...lag for this connection */ > + uint32_t flags; /* open flags */ > + > + /* Pool of VDDK disk handles. Do not access this directly, use > + * GET_VDDK_HANDLE_FOR_CURRENT_SCOPE macro to get a free handle. > + */ > + pthread_mutex_t vddk_handles_lock; > + pthread_cond_t vddk_handles_cond; > + vddk_handles vddk_handles; > }; > > static inline VixDiskLibConnectParams * > @@ -531,17 +556,28 @@ free_connect_params (VixDiskLibConnectParams *params) > static void * > vddk_open (int readonly) > { > - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&...