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. Also removing it does not give me an exception.

In fact I think the problem the blogger has is *not* that he didn't  
use enableMultipleThreads, but rather that he was using the wrong DO  
design. When there are multiple clients you should *not* use the same  
connection for all clients (i.e. use the reverse ports), but rather  
use separate connections for each client (using  
+connectionWithRegisteredName:host: or something similar). His  
'solution' is pretty dangerous as it gives you all the problems of  
thread safety. And isn't thread safety the whole point of our DO server?

>>
>> 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.
Christiaan



-------------------------------------------------------------------------
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