Re: [Phix] Question About Assignment

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

Thread safety. 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.

I was under the impression that ....

Specifying the variable or constant in a function's calling syntax function fu(object bar) made bar specific to the calling instance.

Or specifying a new instance of a type object fu = 1 did not point to any shared instances of fu or 1.

Or maybe i read wrong what you said. Are you indeed saying that if procedure1 and procedure2 call function8, procedure1 and procedure2 are inadvertently sharing data inside function8? Because i thought to share data procedure1 and 2 needed to use the same variables from a level one step higher.

This seems at odds with the rules for named loops. If i do for testloop1 = 1 to 10 do, i can expect nothing anywhere can alter testloop1 while the loop is in force?

Slightly related: does the same hold for OE's tasks?

Slightly related also: wasn't this solved in some degree by scoping?

Considered advertising by some: Mirc makes everything freaking global, but it has a feature OE/Phix don't exactly have: i can pass a variable to a function that becomes part of each variable's name within that function, and the other calling procedures cannot know that variable's name or contents (unless they scan the variable list). I use this (for instance) for client/servers of http, appending the destination ip address (and etc) to the name of the socket.

Kat

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

Search



Quick Links

User menu

Not signed in.

Misc Menu