Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Mattias Gaertner
On Thu, 31 Jul 2008 11:02:28 +0200 Florian Klaempfl [EMAIL PROTECTED] wrote: Before we discuss endless about useless stuff, I'll make a proposal for a first addition: support of the synchronized keyword. It does no more than protecting a procedure automatically by a critical section so only

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Florian Klaempfl
Mattias Gaertner schrieb: On Thu, 31 Jul 2008 11:02:28 +0200 Florian Klaempfl [EMAIL PROTECTED] wrote: Before we discuss endless about useless stuff, I'll make a proposal for a first addition: support of the synchronized keyword. It does no more than protecting a procedure automatically by a

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Michael Schnell
Per class. The question is if it's possible to do this per class instance too. To me Per class does not seem appropriate at all. Per instance in fact seems to make sense. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Florian Klaempfl
Michael Schnell schrieb: Now you suggest that all procedures an instance of this kind of class are protected and thus thread-safe by definition. They aren't but it makes things easier. Just look at the linux kernel: it's smp support started also with BKL: the Big Kernel Lock

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Florian Klaempfl
Micha Nelissen schrieb: Florian Klaempfl wrote: Further, it allows an additional symbol to be given procedure p;synchronized mycriticialsection; Any suggestions about doing it better? How to avoid deadlocks? Indeed, I'am open to any suggestions :) Just an idea: maybe a global call tree

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Micha Nelissen
Florian Klaempfl wrote: Michael Schnell schrieb: Now you suggest that all procedures an instance of this kind of class are protected and thus thread-safe by definition. They aren't but it makes things easier. Just look at the linux kernel: it's smp support started also with BKL: the Big

synchronous class [Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables]

2008-07-31 Thread Martin Friebe
IMHO per class may create some problems? but maybe I am just overlooking something? TBar =class( TFoo ) end synchronized class; Let's say TFoo was declared in another unit, and TFoo was not declared Synchronized. Then TFoo code can be entered by anyone at any time. Even if a thread is in

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Michael Schnell
Just look at the linux kernel: it's smp support started also with BKL: the Big Kernel Lock And since that time they are working to get rid of it. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: synchronous class [Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables]

2008-07-31 Thread Micha Nelissen
Martin Friebe wrote: IMHO per class may create some problems? but maybe I am just overlooking something? TBar =class( TFoo ) end synchronized class; Let's say TFoo was declared in another unit, and TFoo was not declared Synchronized. Then TFoo code can be entered by anyone at any time. Even

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Florian Klaempfl
Micha Nelissen schrieb: Florian Klaempfl wrote: Michael Schnell schrieb: Now you suggest that all procedures an instance of this kind of class are protected and thus thread-safe by definition. They aren't but it makes things easier. Just look at the linux kernel: it's smp support started

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Michael Schnell
Per instance would mean to need an algorithm to automatically define a new Mutex when creating an instance. So maybe the TSynchronizedObject that might be the parent of all class(...) synchronized will define a TSynchronizedObject.Create that creates a Class-common or a system wide Mutex,

Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables

2008-07-31 Thread Marco van de Voort
one thread can enter it. But I want to extend it. First, it can be applied also to classes and object: tmyclass = class(...) synchronized A class protected by a sync object is a monitor. Several other languages have this as a first class citizen. TMyClass = Monitor (xxx) This means