You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usage shown in the readme (compiling thpool.c along with myapp.c) is fine for building applications, but fails for the case of generating the .o for my_library_component.c, which has a struct thpool_* variable inside.
I presume the reason for hiding the definition of struct thpool_ is that, in order to expose it, you'd have to expose some of the other structs as well, and you want to keep those definitions private. But this seems to result in some pretty awkward build semantics. Wouldn't it make sense to just expose those structs, so thpool.c could just be another .o, as we build our own library that uses C-Thread-Pool internally?
Or, alternatively, threadpool could just be an opaque (i.e. void*) handle.
The text was updated successfully, but these errors were encountered:
I think you could insure compiler type-checking of arguments, while also allowing complete definition in the .h, without exposing your internal structs, yet still passing only a pointer-sized value, by doing something like this:
typedef struct { void* dat; } threadpool;
... then casting the value of tp.datinside your functions.
Added C-Thread-Pool as a submodule, based on a forked version that we
control. This was needed to allow us to resolvePithikos/C-Thread-Pool#64, which we do in the
branch "lanl". When we're comfortable with our version, we can issue a
pull-request.
Pulled .h files out of the .c support files.
The Makefile then builds libgufi.a from bf, structq, utils, dbutils, and
thpool.o (from the submodule).
Apps bfwi, bfti, and bfq, are then linked against the library.
Build everything like this:
make clean [optional]
make
[Merge branch 'jti' into gary_merge_jti]
The usage shown in the readme (compiling thpool.c along with myapp.c) is fine for building applications, but fails for the case of generating the .o for my_library_component.c, which has a struct thpool_* variable inside.
I presume the reason for hiding the definition of struct thpool_ is that, in order to expose it, you'd have to expose some of the other structs as well, and you want to keep those definitions private. But this seems to result in some pretty awkward build semantics. Wouldn't it make sense to just expose those structs, so thpool.c could just be another .o, as we build our own library that uses C-Thread-Pool internally?
Or, alternatively, threadpool could just be an opaque (i.e. void*) handle.
The text was updated successfully, but these errors were encountered: