Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Thread und Methodenaufrufe (https://www.delphipraxis.net/129665-thread-und-methodenaufrufe.html)

himitsu 24. Feb 2009 09:30

Re: Thread und Methodenaufrufe
 
Delphi-Quellcode:
lock mov [eax], edx
nur das der Delphicompiler mit dem lock manchma Probleme hat -.-°

Apollonius 24. Feb 2009 09:34

Re: Thread und Methodenaufrufe
 
Himitsu, wenn der Delphi-Compiler das zulassen würde, hätte das lediglich zur Folge, dass dir eine Invalid-Opcode-Exception um die Ohren fliegt. Das lock-Präfix ist nur für Anweisungen gültig, bei denen gelesen und geschrieben wird.

himitsu 24. Feb 2009 10:01

Re: Thread und Methodenaufrufe
 
ich kenn da manchma nur die "External Exception C000001E" in Verbindung mit MOV,
ansonsten geht's bei mov, or, xor, and, cmpxchg und co
und damit wird ja wohl geschrieben/gelesen (oftmals)

Mr_G 24. Feb 2009 11:43

Re: Thread und Methodenaufrufe
 
Danke für die zahlreichen Antworten!
Die Threadpool-Klasse kenne ich natürlich bereits, aber ich denke, dass es kompliziert wird mein Problem auf die Klasse zu übertragen (evtl. auch ein bisschen Overkill).
Das Konzept der Queue für die Jobs könnte ich aber vielleicht für mein Problem nutzen. Mir schwebt da schon etwas vor. Außerdem sollte eine Queue mittels Critical Sections doch ruck zuck Threadsicher zu machen sein, oder?

sirius 24. Feb 2009 11:53

Re: Thread und Methodenaufrufe
 
@himi und Apollo
Zitat:

Zitat von Intel(c)-64 und IA-32 Architcecture
The LOCK prefix can be prepended only to the following instructions and only to those
forms of the instructions where the destination operand is a memory operand: ADD,
ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, DEC, INC, NEG, NOT, OR, SBB,
SUB, XOR, XADD, and XCHG. If the LOCK prefix is used with one of these instructions
and the source operand is a memory operand, an undefined opcode exception (#UD)
may be generated. An undefined opcode exception will also be generated if the LOCK
prefix is used with any instruction not in the above list. The XCHG instruction always
asserts the LOCK# signal regardless of the presence or absence of the LOCK prefix.


Apollonius 24. Feb 2009 12:00

Re: Thread und Methodenaufrufe
 
Das ist doch genau meine Rede. Alle diese Anweisungen lesen eine Speicherstelle aus und schreiben einen veränderten Wert zurück.


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:47 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz