Re: [Phix] Question About Assignment

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

Thread safety.

Ahh, OK. Interesting. 🤔

petelomax said...

If multiple threads are calling (eg) [s]printf(), and that was using a common shared "" constant, they c/would stomp all over each other's reference counts, so using repeat(' ',0) instead of "" creates a new private thread-specific (and in fact call-specific) string, obviously with a private reference count that no other thread can possibly access.

The only "detriment" to using this method for all empty strings would be the footprint size of the app in memory, right? Since it's not sharing the reference, it's making more, thus increasing (by a fraction, no doubt) the app's hold on the available RAM.

Again, just asking for curiosity/knowledge sake!

Thank you!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu