Results 1 to 7 of 7

Thread: Threading on MAC OSX in Lazarus/FPC

  1. #1

    Threading on MAC OSX in Lazarus/FPC

    Ok, I've done my research and it appears that threading isn't supported on a Mac by FPC/Lazarus . Reading it appeared that I should setup my own TThread structure. I modified my code to use MPCreateTask and MPTerminateTask but it still crashes when the thread spins up .

    Any ideas on how to properly spin up and execute a thread on a MAC?

    You can see my attempt in the ATerm demo I posted in the macClient.inc file. Download at: http://www.eonclash.com/ in case you don't want to go searching for it

  2. #2

    Threading on MAC OSX in Lazarus/FPC

    So are you saying that TThread does not work under FreePascal under Mac OS X?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    Threading on MAC OSX in Lazarus/FPC

    I have found myself the LCL doesn't work well with threads in Linux and Windows Sorry to read that about Mac

  4. #4

    Threading on MAC OSX in Lazarus/FPC

    Quote Originally Posted by savage
    So are you saying that TThread does not work under FreePascal under Mac OS X?
    Actually, thats exactly what I'm saying. No one has ever finished the underlying threading model for Mac's . After reading in the Mac Developers stuff and reading the threads on lazarus.freepascal.org I found the MP commands. Problem is, they don't seem to work either .

    Just a matter of figuring out exactly what I have to do to get threading to work on the Mac.

    Any ideas?

  5. #5

    Threading on MAC OSX in Lazarus/FPC

    Is this the doc you are referring to...
    http://developer.apple.com/macosx/mu...ogramming.html
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    Threading on MAC OSX in Lazarus/FPC

    I wrote a small example using TThread on Mac OS X and initially it did not work because I did not have "cthread" in my uses clause in the project file. After adding cthread ( you may want to stick and IFDEF around if you are doing cross-platform stuff ) to my .lpr file the threading example worked fine.

    Now it was fairly simple, so your mileage may vary, but it did work.
    I hope this helps.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7

    Threading on MAC OSX in Lazarus/FPC

    Threading works on MacosX for years (bugs not withstanding) and LCL is exactly like VCL not thread safe.
    Feel the power of Open Source.
    <br />Feel the power of Free Pascal.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •