pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] libcurl initialization requirements


From: Aleksander Morgado
Subject: Re: [pdf-devel] libcurl initialization requirements
Date: Wed, 17 Feb 2010 10:39:07 +0100

> I just noticed that libcurl requires a call to curl_global_init() while the
> program as a whole is single-threaded.  The libcurl docs make this
> quite clear.
> 
> Are we willing to impose this kind of an initialization requirement on
> any and all applications that would link with us?  The requirement
> would be that if http filesystem is included (using libcurl) we would
> need to call curl_global_init while there is only one thread in the whole
> application.  This could mean that we have to be the first lib initialized
> to rule out any other libraries spawning a thread.
> 
> Can we really proceed with libcurl?
> 

We already have that requirement in some base-layer modules, like the
text module or time module. The text module has a
pdf_text_context_init() which should be called once at program startup,
preferably when no other threads are running (so that no other thread
actually tries to call it). That context initialization will store some
internal global data to be used by the text module, like the host
language ID and country ID taken from the locale.

If I understand it properly, the issue here is also that the
`curl_global_init()' shouldn't be called from the new http-fs-specific
init function (as the http FS instance may have been created long after
the program started). If this is the case, the call to
`curl_global_init()' should go in a more general and common
`pdf_fsys_init()' which would then be called by `pdf_init()'. 


Cheers,
-Aleksander





reply via email to

[Prev in Thread] Current Thread [Next in Thread]