Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-03

Correct use of GetThreadManager to Semaphores

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Léo Willian Kölln

In what moment i need call the function GetThreadManager to get it and use semaphore* functions?

Each time i will use some of the functions (a sequence of them), a "per-thread" basis or i can discover it only one time, set for example to a global and use the global aways?

Reply by email

Jonas Maebe
to Léo Willian Kölln

Léo Willian Kölln wrote on di, 24 mrt 2009:

In what moment i need call the function GetThreadManager to get it and use semaphore* functions?

You should never do that. The thread manager is internal. For example, the semaphore* functions are nil in the Windows, see http://bugs.freepascal.org/view.php?id=11206

I don't know whether, and if so in which unit, any semaphore functions are published.

Jonas

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

Reply by email

Léo Willian Kölln
to Jonas Maebe

But then, what is this post about?

So, who i use semaphores on linux? (i want Unix like, specifically Linux. For windows i´m using it´s own API)

Léo Willian Kölln

Jonas Maebe wrote 22 lines
Léo Willian Kölln wrote on di, 24 mrt 2009: > In what moment i need call the function GetThreadManager to get it and > use semaphore* functions? You should never do that. The thread manager is internal. For example, the semaphore* functions are nil in the Windows, see http://bugs.freepascal.org/view.php?id=11206 I don't know whether, and if so in which unit, any semaphore functions are published. Jonas ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to Léo Willian Kölln
Léo Willian Kölln wrote 16 lines
On Tue, Mar 24, 2009 at 12:53 PM, Jonas Maebe < > wrote: > Léo Willian Kölln wrote on di, 24 mrt 2009: > >> In what moment i need call the function GetThreadManager to get it >> and >> use semaphore* functions? > > You should never do that. The thread manager is internal. For > example, the > semaphore* functions are nil in the Windows, see > http://bugs.freepascal.org/view.php?id=11206 But then, what is this post about?

Bad advice. Mea culpa.

Jonas

Reply by email

Léo Willian Kölln
to Jonas Maebe

So... What i do now?
There is no way to use semaphores on Linux?
Not even using a syscall or something?
The bad advice is this one or the one from the link i passed?

Léo Willian Kölln

Jonas Maebe wrote 28 lines
On 24 Mar 2009, at 18:53, Léo Willian Kölln wrote: > On Tue, Mar 24, 2009 at 12:53 PM, Jonas Maebe > wrote: >> >> Léo Willian Kölln wrote on di, 24 mrt 2009: >> >>> In what moment i need call the function GetThreadManager to get it and >>> use semaphore* functions? >> >> You should never do that. The thread manager is internal. For example, >> the >> semaphore* functions are nil in the Windows, see >> http://bugs.freepascal.org/view.php?id=11206 > > But then, what is this post about? > Bad advice. Mea culpa. Jonas_______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to Léo Willian Kölln
Léo Willian Kölln wrote 14 lines
Léo Willian Kölln On Tue, Mar 24, 2009 at 5:41 PM, Jonas Maebe < > wrote: > > On 24 Mar 2009, at 18:53, Léo Willian Kölln wrote: > >> But then, what is this post about? >> > > Bad advice. Mea culpa. So... What i do now? There is no way to use semaphores on Linux? Not even using a syscall or something?

Of course there is (the pthreads unit). I just don't know whether there is a cross-platform unit with semaphore-functionality in FPC.

Jonas

Reply by email

Léo Willian Kölln
to Jonas Maebe

OK!

I will take a look at the pthreads unit. Maybe i make a multi-platform(windows/linux) syncronization unit for the project i´m on and i will try publish it.

Thank you Jonas!

Léo Willian Kölln

2009/3/25 Jonas Maebe :

Show quoted text 28 lines
On 25 Mar 2009, at 14:18, Léo Willian Kölln wrote: > Léo Willian Kölln > > On Tue, Mar 24, 2009 at 5:41 PM, Jonas Maebe > wrote: >> >> On 24 Mar 2009, at 18:53, Léo Willian Kölln wrote: >> >>> But then, what is this post about? >>> >>> >> >> Bad advice. Mea culpa. > > So... What i do now? > There is no way to use semaphores on Linux? > Not even using a syscall or something? Of course there is (the pthreads unit). I just don't know whether there is a cross-platform unit with semaphore-functionality in FPC. Jonas_______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email