celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Broekhuis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CELIX-215) curl_global_init() not called directly
Date Fri, 06 Feb 2015 19:14:34 GMT

    [ https://issues.apache.org/jira/browse/CELIX-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14309677#comment-14309677

Alexander Broekhuis commented on CELIX-215:

Looking at the API of curl, I see how it is intended to use. But looking at the principle
idea of Celix (or OSGi in general) I do not see how to fit the current usage of Curl in Celix.

To clarify, following the spec bundles are loaded unordered, while there currently is a side
effect of the launcher, this is not something we can rely on. Also, any bundle can use Curl,
as such the start/stop point of Curl is not known.

One possible (partial) solution would be to create a separate Curl bundle that takes care
of the global_init and global_destroy calls. Any bundle wanting to use Curl would depend on
this bundle. So in turn curl_easy_init is only used when the Curl bundle is started.
This, however, does not satisfy the Curl requirement that no threads must be started before
calling global_init, because any other bundle not using Curl can already be started and have
started threads as well.

I'll think about this a bit more. Any ideas are welcome as well!

> curl_global_init() not called directly
> --------------------------------------
>                 Key: CELIX-215
>                 URL: https://issues.apache.org/jira/browse/CELIX-215
>             Project: Celix
>          Issue Type: Bug
>            Reporter: Daniel Parker
>            Priority: Minor
> curl_global_init() is called by curl_easy_init() if it has not been called already (so
the system works as-is), but according to the documentation, curl_global_init() is not thread-safe,
so it really ought to be called in launcher.c::main() before it starts spawning threads.
> Also, curl_global_cleanup() needs to be called after we're done with curl.

This message was sent by Atlassian JIRA

View raw message