• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa threading, objects by reference, and the keyword "oneway"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa threading, objects by reference, and the keyword "oneway"


  • Subject: Re: Cocoa threading, objects by reference, and the keyword "oneway"
  • From: Andreas Doerr <email@hidden>
  • Date: Wed, 06 Jun 2001 14:19:29 +0200
  • Organization: Working Objects GmbH

Hi Miguel,

> What I want to do is transfer an object from one thread to another, but
> only using it's reference

*snip*

> (oneway void)sendMap: (in SkyMapClass**) SkyMapReference
> {
> SkyMapClass *newSkyMap;
>
> newSkyMap = *SkyMapReference;
>
> [newSkyMap doSomething];
>
> ... Send it on to the next thread in exactly the same way...
> }
>
> Now if I remove the keyword oneway from the method definition, it works,
> but of course defeats the parallel processing that I'm trying to do.

I don't understand, why you are using the 'oneway' keyword at all! This keyword
is used in the context of remote messaging. If you want to pass a reference
between to threads (which share the same address space) why don't you just pass
it? Of course, you have to synchronize access to this memory location.

If you *really* want to use remote messaging you can't simply pass a pointer
from one process to a remote object in a different process. The pointer will be
automatically dereferenced by the run-time system. For large chunks of memory,
use shared memory in this case.

I also don't understand why you are using several threads at all. Your
processing seems to be strictly sequential ...

Regards,
--Andreas


  • Follow-Ups:
    • Re: Cocoa threading, objects by reference, and the keyword "oneway"
      • From: j o a r <email@hidden>
References: 
 >Cocoa threading, objects by reference, and the keyword "oneway" (From: Miguel Morales <email@hidden>)

  • Prev by Date: Re: Threads in Apps
  • Next by Date: Re: Threads in Apps
  • Previous by thread: Cocoa threading, objects by reference, and the keyword "oneway"
  • Next by thread: Re: Cocoa threading, objects by reference, and the keyword "oneway"
  • Index(es):
    • Date
    • Thread