On Dec 2, 2007, at 8:12 AM, Christiaan Hofman wrote:

>
> On 2 Dec 2007, at 4:48 PM, Adam R. Maxwell wrote:
>
>>
>> On Dec 2, 2007, at 5:25 AM, Christiaan Hofman wrote:
>>
>>> Another question. Should we actually make the connection multi
>>> threaded? I think it's wrong. It's only accessed from a singl  
>>> thread.
>>
>> Check the comment in -init and that blog post linked.  It's necessary
>> because we use the same ports on the other end.  Removing it leads to
>> exceptions.
>>
>
> Really? I understand this differently. Note they're still different
> connections. The post (and the docs) says that you gat the same
> connection if you use the same ports *in the same order* for the
> connection, in the case of the post when you use multiple clients
> with the same ports.

Yeah, Tsai's setup seems odd, and he's quoting a different section of  
the docs.  That was just a reminder of the problem.  The part I quote  
in -init says:
"If an NSConnection object exists that uses the same ports, but  
switched in role, then the new NSConnection object communicates with  
it. Messages sent to a proxy held by either connection are forwarded  
through the other NSConnection object. This rule applies both within  
and across address spaces."

I interpret this to mean that if the ports are reversed on the other  
end, you end up communicating through the original connection.  It's  
not clear what the implications are; the DO documentation is not good,  
as far as I'm concerned.  I filed a radar months ago asking for  
clarification on -enableMultipleThreads and a separate one asking for  
docs on deallocating an NSConnection.


> Also removing it does not give me an exception.

Ah, but the exception doesn't occur all the time (or it may only occur  
on dual proc systems...I forget).  For even more fun, multiple threads  
are enabled by default on 10.5, but disabled by default on 10.4.

I originally added enableMultipleThreads because I hit that exception  
during development.  Since I forgot to comment it, I removed it last  
May since it seemed unnecessary (using a similar argument to yours),  
tested it, and it worked fine.  We then released a new version and got  
a couple of exception reports (I was able to reproduce it).


>>> On 2 Dec 2007, at 2:05 PM, Christiaan Hofman wrote:
>>>
>>>> Sorry, I see you already removed oneway from setLocalServer:.
>>
>> Yes, for precisely that reason.  It's fast anyway, since we're  
>> dealing
>> with NSMachPort.
>>
>> -- 
>> adam
>
> Right.
>
> BTW, couldn't we just use [mainThreadConnection rootProxy] for the
> serverOnServerThread? It's the same object.

I don't know.  I'm pretty disinclined to mess with it now, since I  
know it's working on Tiger and Leopard.




-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to