[fpc-devel]RE: Free Pascal version 1.0.6 released
Michael Van Canneyt
michael.vancanneyt at wisa.be
Tue May 7 09:57:14 CEST 2002
On Tue, 7 May 2002, Michael Schnell wrote:
> == Ursprüngliche Mitteilung von ccodere at ieee.org am 6.05.02 23:14
> >Now that v1.0.6 is released, work will be concentrated on v1.1 of the
> >compiler, which will eventually form the v1.2 release.
> >
> >multithreading...
>
> === Kommentar von MSCHNELL at LUMINO (Michael Schnell) am 7.05.02 09:04
>
> I did an implementation of TThreads for Free Pascal some months ago. It does
> work, but we can not use several FP features of OPs, as things like creating
> an instance of a class, long strings and such things that use the memory
> management are not thread-safe.
>
> We tried to make the heap management thread save (without using my TThread
> class, even without using classes at all, just using clone() to create a new
> process) by introducing a locking mechanism, but in the end failed due to
> still unknown reasons.
>
> We were able to make the same project run safe when we set the clone flags
> _not_ to share memory between the processes. Of course we could not use nice
> and easy inter thread communication like TThreadList (which is very easily
> derived from TList)
Not sharing the memory defies the idea of threads of course.
>
> Can/should I work with you on the implementation of multithreadding in FP ?
The 1.0.6 branch will not be updated to contain thread-safe routines.
There is a framework for this already in the 1.1 series; It should be
basically working for Win32, for Linux one or two functions should still
be implemented. You can contact me or Florian Klaempfl for more details.
Basically what is still missing is a semaphore mechanism (for
EnterCriticalSection/LeaveCriticalSection routines), and the
allocation of thread variables. But that must be implemented using
assembler instructions. I had a look at pthreads, and we're now at
a point where we should be able to settle the matter.
But since (as always) there is a lack of time, you're welcome to help
out.
Michael.
More information about the fpc-devel
mailing list