Commit graph

2447 commits

Author SHA1 Message Date
4e31db5a74 my private convenience wrapper for running an exe with valgrind 2010-02-13 06:01:49 +01:00
dc991ca563 valgrind suppression: add some more cases to be filtered 2010-02-13 06:00:38 +01:00
b41bd20de4 push accessing the DiagnosticContext down one layer
accessing the DiagnosticContext now inline when
providing the paramters for calling the C-functions.
No change in functionality, but saves us a lot of
syntactic noise.
2010-02-13 05:33:08 +01:00
3466793976 repackage as a more general facility (DiagnosticContext)
implementation unaltered (just managing the NoBug handle)
2010-02-13 04:54:59 +01:00
4dfd7266b9 draft solution to factor out management of the resource handle
based on the idea of a diagnostic context stack
2010-02-13 04:03:27 +01:00
Michael Ploujnikov
433448ff44 use _join() instead of a second _sync() to wait for the worker to finish 2010-02-12 07:20:32 -05:00
763f86fe0e back out changes I do not want in lib/sync.hpp
especially, I do not want to pass a resource handle
through all locking function APIs; the memory
management of the resource tracker should better
be kept separate and not mixed with the monitor.

Also, I am rather reluctand regarding any extended
functionality for the monitor, like timed locks
or trylocks or read/write monitors. I think, the
monitor pattern is only beneficial when it is kept
fairly simple, advanced thread programming should
be pushed out into lib functions in the backend.
2010-02-12 05:22:17 +01:00
b556343fb6 re-enable typed-counter-test; passing just fine again 2010-02-12 01:54:12 +01:00
52a7d6993d SCons: remove GThreads from linking (except for the GUI) 2010-02-11 03:19:42 +01:00
dfd70c6069 replace GThreads by the Lumiera thread wrapper 2010-02-11 03:06:42 +01:00
Michael Ploujnikov
d80ae17ea4 test simple-sync: avoid a race condition in output checking by using an assert 2010-02-10 20:53:44 -05:00
Michael Ploujnikov
62b70bfd7e test sync-joinable: use asserts instead of checking the program output 2010-02-10 20:53:32 -05:00
Michael Ploujnikov
5d929f1522 test sync-many: replace output checking with asserts
Also modify the input value right after passing to a worker thread. This is a better test of synchronization.
2010-02-10 20:53:13 -05:00
Michael Ploujnikov
5606eb2d83 Merge remote branch 'ct/backend_devel' into second-tp-attempt
Conflicts:
	src/lib/error.c
2010-02-09 07:29:43 -05:00
Michael Ploujnikov
25ec9a91f7 don't forget to free the error struct 2010-02-09 07:21:58 -05:00
Christian Thaeter
26f88bc3f1 Merge remote branch 'plouj/second-tp-attempt' into backend_devel
* plouj/second-tp-attempt:
  basic joinable thread test
  joinable thread sync test
2010-02-08 18:20:05 +01:00
Christian Thaeter
80e2db4800 hook the resourcecollector into safeclib on backend startup 2010-02-08 17:47:26 +01:00
Christian Thaeter
d103346482 hook mpool into the resourcecollector and using safeclib allocations 2010-02-08 14:28:54 +01:00
Christian Thaeter
9feb01e4fe add hooks for malloc/free to mpool, add (no-op) purge function
We will need this to hook the resourcecollector in
2010-02-07 20:53:51 +01:00
Christian Thaeter
b60d8aa907 FIX: error.c memory leak when destroying threads
the error context is dynamically allocated and must be freed, forgotten
this as errors originated from static strings initially.
2010-02-07 20:25:09 +01:00
5386fe6fbc clarify (and treat) the race; considered to be test-only
After removing the explicit locking, there is a small
race in case of a "floundering" (simulated) subsystem:
the starting context may go away before the child thread
actually teminates. I consider this a shortcoming of
this test fixture, which isn't intended to be an example
of a real world subsystem, but rather focusses on
error detection within the subsystem runner.
2010-02-07 17:31:28 +01:00
8ad3bf1736 Change subsystem-runner test to remove explicit locking entirely 2010-02-07 02:56:30 +01:00
Christian Thaeter
33a0591689 Make resourcecollector initialization explicit
instead automatic initialization, the resourcecollector is pulled up as
backend service.
2010-02-05 09:20:52 +01:00
Christian Thaeter
d350a250fa Move the resourcecollector to the backend, closes #521 2010-02-05 08:58:19 +01:00
Michael Ploujnikov
c64984b859 Merge remote branch 'ct/backend_devel' into second-tp-attempt 2010-02-04 22:48:03 -05:00
Christian Thaeter
d45b2eef91 factor the filedescriptorregistry out, closes #395
also introduces a new mutex for lookup/creating files to prevent races
2010-02-04 22:52:21 +01:00
Christian Thaeter
53a747dcca add little more cleanups to mmap.tests 2010-02-04 22:30:46 +01:00
Christian Thaeter
40d1bb50bb fix double-free bug in mmap.c 2010-02-04 21:56:49 +01:00
Christian Thaeter
97d5b1c727 remove the 'once' hack from mmap_init() 2010-02-04 20:43:27 +01:00
Christian Thaeter
c1c97228a5 Set error condition when chunksize for a non mmaped file is queried 2010-02-04 20:41:49 +01:00
Christian Thaeter
4821e7eb3f add file_delete_unlink() which removes a file from disk when closed
For temporary file, only removes the name under which it was opened
2010-02-04 20:40:54 +01:00
c406d16fbc threadwrapper-test should have been better written this way... 2010-02-04 18:48:47 +01:00
Christian Thaeter
31a2f454d8 remove lumiera_fhcache as parameter, closes #396 2010-02-04 10:21:20 +01:00
Christian Thaeter
cdd8136524 uppercase the 'TESTS' nobug flag for the testsuite, fix tests
this flag is little special and can be confused with runtime flags
2010-02-04 09:47:29 +01:00
Michael Ploujnikov
48829bc9ad basic joinable thread test 2010-02-03 17:06:27 -05:00
Michael Ploujnikov
bd6ed5aa88 joinable thread sync test
Right now causes 32bytes to be lost
2010-02-03 08:02:41 -05:00
Christian Thaeter
711af29605 Merge remote branch 'plouj/second-tp-attempt' into backend_devel
* plouj/second-tp-attempt:
  added two sync tests
  show the state name string
  it is more proper to use cond_sync flags for *CONDITION_SECTIONs
  add a threads/threadpool NOBUG flag hierarchy
  replace an old test with a compile-only one which spawns way too many threads
  increase the delay in threads to 10ms
  wrap prime test in usleep() to make the thread likely to be re-scheduled
2010-02-03 10:51:03 +01:00
Christian Thaeter
7ef1bab914 premature fix for the threadwrapper test
Added some more fuzz and sleeping to the test calculation to have a actual
chance to fail when something is not well locked.

Using a premature classlock, locking instances was insufficient.
2010-02-03 10:45:58 +01:00
Christian Thaeter
01839d4e48 update for nobug-201002.1 2010-02-03 10:38:12 +01:00
Michael Ploujnikov
73f1bbae2a added two sync tests
one with a single thread and one with 100 randomly sleeping ones
2010-02-02 20:44:35 -05:00
Michael Ploujnikov
6d053d3f84 show the state name string 2010-02-01 16:51:27 -05: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
Michael Ploujnikov
c57c02ea45 replace an old test with a compile-only one which spawns way too many threads 2010-01-31 20:05:05 -05:00
Michael Ploujnikov
79f8481f99 increase the delay in threads to 10ms 2010-01-31 19:46:48 -05:00
Michael Ploujnikov
64ab9f6bf7 wrap prime test in usleep() to make the thread likely to be re-scheduled 2010-01-31 13:33:47 -05:00
Christian Thaeter
014c83ff5a PTHREAD_ONCE_INIT can be a macro, fast init trick doesn't work then 2010-01-30 08:40:38 +01:00
Christian Thaeter
2b74d82f13 remove threadpool initialization, this is done elsewhere now
Subsystem runner/-test is still broken, sometimes segfaults
2010-01-30 07:37:32 +01:00
Christian Thaeter
32d9a9f9ad FIX: thread-wrapper proxy the catched error up to the joiner 2010-01-30 07:20:09 +01:00
Christian Thaeter
e4e87e8cdd log error while setting it 2010-01-30 07:20:09 +01:00