Threading (Invoke) under CocoaSharp, and other minor questions...

1 view
Skip to first unread message

Jop... (Jonas F. Jensen).

unread,
Aug 10, 2007, 10:25:04 AM8/10/07
to cocoa-sharp-dev
Hi,

I'm trying to port an .Net application to OS X using Mono and
CocoaSharp. I've successfully ported it with windows.forms, and I've
also got it running under Linux with GTK#...
So now it's time for a CocoaSharp port.

My first question is what threading issues are there with Cocoa# ?
Under Windows.Forms and GTK#, there's one UI-thread which may change
controls/widgets. If I have to do it from a worker thread I'll have to
call Gtk.Application.Invoke() or System.Windows.Forms.Form.Invoke(),
how is it done in a Cocoa# application...
( I have tried, but I don't think it's possible to do this in a GUI
indenpendt manner )
I assume Cocoa isn't thread safe, right?

Secound question, how to get documentation? I've generated some with
monodocer directly from the cocoa-sharp.dll, and then converted them
to html with monodocs2html... But isn't there some real documentation
anywhere??? how do I get it? and how do I view it?

Third question, is there any intelisens support for C# in Xcode?

By the way, the project I'm working on is TheLastRipper, an opensouce
audio ripper for last.fm: TheLastRipper.com or code.google.com/p/
thelastripper

//Regards Jop... (Jonas F. Jensen).

Jop... (Jonas F. Jensen).

unread,
Aug 11, 2007, 10:34:03 AM8/11/07
to cocoa-sharp-dev
I think I found the answer for my question here:
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/articles/CocoaSafety.html

It seams, as I might have suspected, that most objects in Cocoa are
threadsafe... :)


On 10 Aug., 16:25, "Jop... (Jonas F. Jensen)." <jop...@gmail.com>
wrote:

Chuck Esterbrook

unread,
Aug 11, 2007, 8:44:31 PM8/11/07
to cocoa-s...@googlegroups.com
That page correctly states that mutable objects (mutable arrays,
dictionaries, sets, etc.) are NOT thread safe. And that you have to
take some care with NSView drawing and other things. It also says
"There is some possibility that window objects may leak in an
application that deals with a lot of windows concurrently."

Your own objects will not be safe unless they are immutable or you
take explicit steps to make them safe.

There are some things it handles gracefully, but overall it's pretty
much like other GUI libraries.

-Chuck

Reply all
Reply to author
Forward
0 new messages