mpg123 porting: libmp3lame non-parallel init code?
Thomas Orgis <[email protected]> Sun, 27 Aug 2017 13:41:37 +0200
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Message-ID | <20170827134137.1f1a3c36@sturbolzen> |
Hi, I am wondering about the libmp3lame API and the possibility to slip in the call to mpg123_init() (also mpg123_exit(), respectively, although that does not do anything yet) at some place. The thing is that this call should happen exactly once to initialise various tables, check CPU properties … stuff that needs to run only once. Am I right in assuming that lame_init() is _not_ the right place, as it can be called many times to create multiple instances in a parallel program? I might have to overthink my approach, perhaps. So far it was no problem in client code to have mpg123_init/exit() in non-parallel sections, but when hiding the library API behind another library API, I see that I might be in trouble. I do not really want to add synchronisation directives inside libmpg123 … but perhaps I can fill some tables at build-time instead and do other stuff like CPU checks anew for each instance of a library handle, finally biting the bullet to eliminate the need for mpg123_init(). So … is this necessary for wrapping libmpg123 inside libmp3lame? Am I correct in believing that there is no entry point for non-threadsafe initialisation? Alrighty then, Thomas ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Lame-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lame-dev