concat
не заполнит пробелы. Вам нужно сделать merge
на ваших фреймах данных. Чтобы объединить несколько DF, я всегда делаю:
df_new = df1.merge(df2, on='timestamp', how='outer')
df_new = df_new.merge(d3, on='timestamp', how='outer')
И продолжаю ..
I read somewhere that if you compile with -pthread, malloc becomes thread safe. I´m pretty sure its implementation dependant though, since malloc is ANSI C and threads are not.
If we are talking gcc:
Compile and link with -pthread and malloc() will be thread-safe, on x86 and AMD64.
Another opinion, more insightful
{malloc, calloc, realloc, free, posix_memalign} of glibc-2.2+ are thread safe
http://linux.derkeiler.com/Newsgroups/comp.os.linux.development.apps/2005-07/0323.html
Вопрос: "Реентерабельность malloc"?
Ответ: нет. Вот одно определение того, что делает процедуру реентерабельной .
Ни одна из распространенных версий malloc не позволяет вам повторно вводить ее (например, из обработчика сигналов). Обратите внимание, что реентерабельная процедура может не использовать блокировки, и почти все существующие версии malloc используют блокировки (что делает их поточно-ориентированными) или глобальные / статические переменные (что делает их поточно-небезопасными и небезопасными).
Все ответы, полученные до сих пор, дают ответ «является ли malloc потокобезопасным?», что является совершенно другим вопросом. На этот вопрос ответ зависит от вашей библиотеки времени выполнения и, возможно, от используемых вами флагов компилятора. В любой современной UNIX по умолчанию вы получите потокобезопасный malloc. В Windows используйте / MT
, / MTd
,
No, it is not thread-safe. There may actually be a malloc_lock()
and malloc_unlock()
function available in your C library. I know that these exist for the Newlib library. I had to use this to implement a mutex for my processor, which is multi-threaded in hardware.
It depends on which implementation of the C runtime library you're using. If you're using MSVC for example then there's a compiler option which lets you specify which version of the library you want to build with (i.e. a run-time library that supports multi-threading by being tread-safe, or not).