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
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
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
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
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
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
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
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
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
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
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,
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
12 matches
Mail list logo