Mark, Hadn't dug into the internals of ports enough to know that (have only scratched the surface). That is good to know, though. Thank you. Saves work. Freja On June 19, 2017 7:13:00 PM GMT+02:00, Mark H Weaver wrote: >Freja Nordsiek writes: >> Hmm, just realized, to add on top of what you said, method has a >major >> thread-safety problem if the bytevector output port is accessed from >> more than one thread. Definitely need to fix this. > >In Guile, port operations are not specified to include built-in thread >synchronization. Thread synchronization is quite expensive on most >platforms, and only needed in a small minority of cases, so it should >be >added by the application where needed. Bytevector port operations >could >be made quite cheap in a future implementation of Guile with native >code >generation, and we should avoid making promises that would add >significant work to inherently inexpensive operations. > > Thanks, > Mark