3f1b7651e9
GPL header whitespace
2010-12-17 23:28:49 +01:00
Michael Ploujnikov
8588fa2b9c
it is more proper to use cond_sync flags for *CONDITION_SECTIONs
2010-02-01 07:25:49 -05:00
Michael Ploujnikov
b799321dff
add a threads/threadpool NOBUG flag hierarchy
...
and remove redundant/errorneous flag initializations as a result
also use the test flag from logging.h
2010-02-01 07:25:06 -05:00
Christian Thaeter
812f7112af
FIX: small race in acquire_thread, catching threads out of the void
2010-01-30 02:56:50 +01:00
Christian Thaeter
f57d637b59
Merge commit 'dc87e78590ea86615d3ebe90d23af4548445b941' into backend_devel
...
* commit 'dc87e78590ea86615d3ebe90d23af4548445b941':
add a two-thread acquire test
show the state of the thread in question
minor fixes: remove an old comment and change another
fix the prime test algorithm
use unsigned long for even more digits!
2010-01-30 00:48:04 +01:00
Christian Thaeter
9fc68c9d32
Merge remote branch 'public/nobug201001.2' into backend_devel
...
* public/nobug201001.2:
integrating nobug context passing
updates for nobug 201001.2
Conflicts:
configure.ac
src/lib/condition.h
src/lib/reccondition.h
tests/backend/test-threads.c
2010-01-23 06:56:39 +01:00
Michael Ploujnikov
fc15a2ac2c
Merge commit '6f07e4eedc6b624b1f9ae1004ad3e6a77027e028' into second-tp-attempt
...
Conflicts:
src/backend/threads.c
2010-01-20 21:41:14 -05:00
Michael Ploujnikov
571c265ccd
minor fixes: remove an old comment and change another
2010-01-20 07:58:22 -05:00
Christian Thaeter
95fed7fd0e
remove thread counters (for now)
...
counting the threads had a race when creating threads, with moving
threads only between idle and working list we don't need the counters for
operation anyways. Maybe later when we find out that we need them we can
re-add them in a sane way
2010-01-20 01:03:41 +01:00
Christian Thaeter
12968bb784
thread kind and flag handling
...
* 256 states are enough for anyone (else fix the source)
* add proper masking and handling of flags
2010-01-20 00:43:11 +01:00
Christian Thaeter
020908d623
Make threadpool_destroy wait until all threads are finished
...
adds a state to each threadpool which can be only offline or online.
One can not acquire new threads when the pool is offline.
no need for waits in the teststuite anymore.
2010-01-18 17:53:33 +01:00
Michael Ploujnikov
c78571be55
more formatting fixes to put spaces before function/macro call opening brackets
2010-01-16 13:53:42 -05:00
Michael Ploujnikov
fa85a01818
add a stronger REQUIRE check
2010-01-16 13:13:02 -05:00
Michael Ploujnikov
02c9ee33c7
fix the code by re-merging some of cehteh's changes
...
test still fails
2010-01-16 11:48:48 -05:00
Michael Ploujnikov
e9ae8c8601
add a thread state check and remove an old comment
2010-01-15 07:35:28 -05:00
Michael Ploujnikov
f62513dea8
fix compilation errors
2010-01-14 16:46:27 -05:00
Michael Ploujnikov
ecbcfdefd7
remote unnecessary calls to llist_unlink() insert is enough
2010-01-12 07:39:12 -05:00
Michael Ploujnikov
f890b35a03
continuation of working_list introduction
2010-01-11 15:04:52 -05:00
Michael Ploujnikov
925442b3d9
begin adding a second list to store working threads
2010-01-09 21:36:20 -05:00
Michael Ploujnikov
4708326b77
Merge branch 'minor-fixes' into second-tp-attempt
...
Conflicts:
src/backend/threadpool.c
src/backend/threads.c
2010-01-07 18:27:09 -05:00
Michael Ploujnikov
30a46a6255
Merge remote branch 'public/minor-fixes' into minor-fixes
...
Conflicts:
src/backend/threadpool.c
src/backend/threadpool.h
src/backend/threads.c
2010-01-07 18:24:25 -05:00
Michael Ploujnikov
d989babc8a
Merge remote branch 'ct/for_plouj2' into second-tp-attempt
...
Conflicts:
src/backend/thread-wrapper.hpp
src/backend/threadpool.c
src/backend/threadpool.h
src/backend/threads.c
2010-01-07 07:18:23 -05:00
Michael Ploujnikov
223e79cc4a
replace mutex with condition variable in threadpool
...
use TRACE instead of ECHO
(based on cehteh's suggested code)
2010-01-04 17:03:47 -05:00
Michael Ploujnikov
7a507a0cee
don't put threads in a detached state
2009-12-31 15:09:22 -05:00
Michael Ploujnikov
d63a6066a0
insert a space between the function name and the ( in each function call
2009-12-31 07:27:45 -05:00
Michael Ploujnikov
9c60d88c56
remove thread limiting logic from the threadpool
2009-12-31 07:24:07 -05:00
Michael Ploujnikov
69277b6770
remove unused function pool_thread_loop()
2009-12-31 07:18:29 -05:00
Christian Thaeter
88195087d6
recondition to condition,
...
remove the mutex from the pool
rename park to release :P
2009-12-24 01:54:49 +01:00
Christian Thaeter
6b4415d8fa
nobugify
...
declare and init the nobug flags and use them for logging diagnostics
2009-12-24 01:50:59 +01:00
Christian Thaeter
026fab07dc
cosmetics, deadcode removal
2009-12-24 01:46:43 +01:00
Christian Thaeter
bddb23d111
remove threadpool_unlink()
...
thread removes itself from the list, this is trival in place
2009-12-24 01:45:44 +01:00
Michael Ploujnikov
f2406c23a1
bork bork bork
...
by pulling this you agree to...
2009-12-23 13:10:31 -05:00
Michael Ploujnikov
098d801d00
give each thread pool a separate pthread_attr_t structure to configure
2009-12-02 22:21:49 -05:00
Michael Ploujnikov
afe135f43e
add a lock around thread pool list access in lumiera_threadpool_release_thread()
2009-12-02 13:48:08 -05:00
Michael Ploujnikov
c31bc2791b
remove unnecessary REQUIREs based on my new understanding of nobug
2009-11-26 11:52:19 -05:00
Michael Ploujnikov
afd2035983
rename threadpool.kind[i].pool to threadpool.kind[i].list
...
rename threadpool.kind to threadpool.pool
2009-11-26 11:27:50 -05:00
Michael Ploujnikov
af80622ef5
begin implementing a 'soft' thread count limit per pool
...
add LUMIERA_DIE in cases where this soft limit is reached
add LUMIERA_DIE when pthread_create fails to create threads - serious
add a test which tries to break the soft limit
2009-11-26 10:24:18 -05:00
Michael Ploujnikov
98c608d4c0
check that we're creating valid lumiera_thread_structures
...
die on pthread_create errors that we shouldn't be handling
2009-11-26 10:24:18 -05:00
Michael Ploujnikov
07962b5314
add comments about locking in lumiera_threadpool_release_thread()
...
output the size of the created thread struct
don't print "destroying thread" (lets tests become shorter with repeated matching)
add a test which spans many threads in all pools
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
8e3d4e7b7a
fixed lumiera_threadpool_destroy() by using LLIST_FOREACH
...
added some checks to lumiera_threadpool_release_thread(), maybe too much
modified thread_loop() to return a known value - 0
added checks to lumiera_thread_new()
added a check to lumiera_thread_destroy()
made lumiera_thread_destroy() unlink the thread from a pool list
updated test case to match new debug messages
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
d6d81f2e44
added lumiera_threadpool_destroy()
...
added locking and checks to lumiera_threadpool_acquire_thread()
added a nobug flag to threads.c
added lumiera_thread_destroy()
added lumiera_thread_delete()
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
414b8b99c3
updated test passes
...
fixed problem with copying lists
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
75696986e4
test passes
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
10f79290a1
add lumiera_threadpool_release_thread
...
make the test compile
change from type to kind
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
9dd838b129
acquire() test started, so far, everything just compiles
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
775f6cbb5d
actually create or use a thread struct, still not associated with a pthread
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
00eb4eda46
partial code skeleton
2009-11-26 10:24:17 -05:00