This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Do threads within single process share FILE streams?


Hello!

I know this list is not perfect for such question, but I'm sure you know the answer (; I really couldn't find anything definitive on the internet...

Do threads within single process share FILE streams? I know that threads share file descriptors, but do they share FILE streams too? Newlib's source suggests that FILE streams are _NOT_ shared between threads - they are allocated in _reent structure, which is (I assume) per thread. But on the other hand - if FILE streams are not shared (implicitly), then the locking (with _newlib_flockfile_start() and _newlib_flockfile_end()) is mostly pointless and would make sense only when you share the FILE streams explicitly by using the same FILE variable from multiple threads, right?

Thanks in advance!

Regards,
FCh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]