Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 868399 - dev-libs/json-c: consider enabling threads by default (IUSE="threads")
Summary: dev-libs/json-c: consider enabling threads by default (IUSE="threads")
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jakov Smolić
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 868336
  Show dependency tree
 
Reported: 2022-09-04 08:57 UTC by Holger Hoffstätte
Modified: 2023-08-12 17:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2022-09-04 08:57:05 UTC
json-c has partial support for "thread safety", as documented at:
https://github.com/json-c/json-c

It is probably configurable due to toolchain problems with uClibc. While JSON parsing hardly requires multi-core scalability, we shoud probably (IMHO) enable thread safety unconditionally if only for safety reasons, even if that implies a performance hit.
That being said, by default ENABLE_THREADING is OFF and purely single-threaded access to json-c and a parsed object tree should be fine either way, so I'll leave the decision to the maintainer.

Ultimately the real problem here - just as with any other library - is that the configuration decision is not with json-c but with the application that uses it.
Currently there is no ebuild in the tree that explicitly requires json-c[threads].


Reproducible: Always
Comment 1 Holger Hoffstätte 2022-09-04 09:44:40 UTC
An alternative course of action would be to rename threads to thread-safety (default off?) so that any consumer packages can explicitly declare what they require.
Comment 2 Holger Hoffstätte 2023-08-12 17:45:10 UTC
As documented in https://github.com/json-c/json-c/blob/master/README.md the ENABLE_THREADING CMake option is disabled by default and actually incomplete.
Enabling it by default would therefore be misleading.