12

I need to port an application (written in XE2) to Mac.

My application is split into a simple UI executable (single-threaded) and an invisible engine (which heavily relies on OmniThreadLibrary 3.02 and Cromis DirectoryWatch)

Both EXEs communicate via Cromis.IPC

This is to say that I mainly have issues with these 3 components (OmniThreadLibrary, Cromis IPC & DirectoryWatch)

My focus right now is the Engine, which has most of the code.

My question is: Is there something similar to OmniThreadLibrary, Cromis DirectoryWatch & Cromis.IPC for Mac? (Whether with lazarus or XE2 with Mac as a target compiler)

The answer will help me a lot in deciding whether I should use Delphi XE2 or Lazarus (an IDE which I'm not familiar at all with) and see what's the best long term approach to offer/support both Windows & Mac with the minimum headaches

TheDude
  • 3,045
  • 4
  • 46
  • 95
  • 2
    ... there should be a cross-platform concurrency support library for Delphi, really ... – mjn Jan 13 '13 at 12:59
  • Is there much use of Delphi OSX compiler? Is it going to go the way of Kylix, or is anyone using it? – David Heffernan Jan 13 '13 at 17:13
  • 1
    @David: we use it with great succes. Quite unlike our Kylix adventures actually ;-) – Giel Jan 13 '13 at 18:32
  • For IPC, you could use RemObjects, which is cross-platform. Threading libraries should port okay unless they use Windows APIs, in which case you could go back to plain TThread. Watching a directory you could do an equivalent. Sorry, no instant solution, but options. – mj2008 Jan 14 '13 at 09:03
  • 2
    @mj2008: Honestly I didn't look into OTL source code, but I tend to think it's heavily tied to Windows API (I know for sure that Cromis DirectoryWatch is). Also, I'm afraid TThread is absolutely no match for OTL, I can't even imagine using it anytime soon! – TheDude Jan 14 '13 at 20:50
  • 1
    RO is a bit expensive (I mean 400 $ just for the IPC, man that hurts!), but it seems to be something to look at as a last resort, thanks! – TheDude Jan 14 '13 at 20:51
  • 2
    OTL is windows only because it resorts to windows messaging and windows API to wait in a lot of places, so, for now, OTL is not an option for cross platform. – jachguate Jan 17 '13 at 03:52
  • http://stackoverflow.com/questions/504152/delphi-on-the-mac-possible – thang Jan 20 '13 at 06:44
  • 1
    I can comment on DirectoryWatch and IPC components as I am the author of them. IPC could maybe, maybe be ported as the notion of Pipes is present on both Linux and Mac. The problem is it would still be a lot of work to abstract away from Windows API. I also do not see the benefit in case of MAC. I don't use it and don't intend to so I have no interest there. DirectoryWatch is even worse as it revolves around one single Windows specific API. I don't even know if a counterpart exists on MAC. – Runner Jan 24 '13 at 11:30

1 Answers1

1

I am answering the part of your question dealing with compiler /IDE. I've used Lazarus and I must say that it won't take you too long to get up to speed (except for your exact requirements). Lazarus is getting more and more professional; a number of the developers are professional Delphi / XE2 coders by day. I think since you want to make your application available on Mac, you are going to have some work cut out anyway. But, it you decide to use Lazarus, you can for the most part build applications for Linux, Mac, and Windows without much effort ... most things just build right for each of the platforms from the same mostly unmodified source. Of course, as you say, your code heavily leans on OTL With OTL being a windows only library, I think you are going to have your work cut out for you. (read ... you might have to write an equivalent library yourself, or have someone do it for you) As for Chromis Directory watch, I haven't found anything yet.

I hope this helps a bit. CHEERS

This Lazarus tutorial shows that threading functionality built in. I am unaware of an equivalent library for what you are searching for. CHEERS

happy coder
  • 1,517
  • 1
  • 14
  • 29
  • IMHO change OTL doesn't mean _some rewriting_ but a entire one, since you have to change all your approach of the problem and resort to much more basic constructs, like TThread, manual data pass. Do you @happy coder really know OTL? – jachguate Jan 20 '13 at 03:39
  • Well, I guess I used some Canadian understatement there. I'm aware it is a big job. And no I don't know OTL, just what I've sussed out in combing the web a bit. My comment about Lazarus stands though, the fact that your particular problem may require a large re-write does not null the fact that the Lazarus environment is very approachable. CHEERS! – happy coder Jan 20 '13 at 03:45
  • it's not my problem, as I'm not the OP. Your statements may be true, but remember you're first answering to the specific OP question which involves OTL, and IMHO, OTL is the main problem here and not the compiler. Cheers!! :) – jachguate Jan 20 '13 at 03:52
  • @jachguate, thanks for the comment. It is good advice. I've edited my response to more accurately reflect the part of the question I was focusing on. (I'm somewhat new here, so I do appreciate your comment). I didn't delete my response because it does give a good answer to the title of the posting, and anyone scanning the questions who is interested in this question will be left with something I think is useful. CHEERS – happy coder Jan 20 '13 at 06:38
  • Thank you for the advice happy coder and @jachguate. I fully agree with jachguate, OTL lives in a different galaxy, far away from TThread. I found a library called [Threadpool Engine](http://pages.videotron.com/aminer/), the auther indicated that he previously worked with [Primoz Gabrijelcic](http://www.thedelphigeek.com/) (the author of OTL). I have no idea how good is it, but it's the only one that goes beyond TThread in FreePascal. Primoz already indicated how he felt about Delphi & Mac in a [podcast sometime ago](http://delphi.org/2010/05/41-primoz-gabrijelcic-omnithreadlibrary/) – TheDude Jan 21 '13 at 20:40
  • As for Cromis.DirectoryWatch, the closest (actually the only :() thing I could find was [something called inotify](http://www.friends-of-fpc.org/research/LinuxProgramming/inotify/). If **anyone knows another reference**, please feel free to add it here. – TheDude Jan 21 '13 at 20:44