Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
[RESOLVED] FileMode and multi-thread
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
The compiler fails to war...
by
AlexanderK
[
Today
at 12:17:05 pm]
Stacked bars not drawn pr...
by
wp
[
Today
at 11:51:42 am]
four squares (inc)
by
speter
[
Today
at 11:25:05 am]
Regarding the issue of de...
by
Martin_fr
[
Today
at 10:20:35 am]
Dice (raylib + kraft phys...
by
fcu
[
Today
at 09:01:24 am]
CudaText editor (written ...
by
AlexTP
[
Today
at 07:57:52 am]
Lazarus seems to be makin...
by
Boleeman
[
Today
at 07:54:25 am]
[SOLVED] Lazreport PDF
by
Petrus Vorster
[
Today
at 07:42:59 am]
Maze Makers: Modified Cyl...
by
Boleeman
[
Today
at 07:20:10 am]
How to set the Excel cell...
by
dodgex
[
Today
at 04:51:41 am]
[SOLVED] Assembler error ...
by
Thausand
[
Today
at 01:25:35 am]
Embedded qss stylesheets ...
by
jns
[January 14, 2026, 11:27:39 pm]
New book on Object Pascal
by
BodgerBen
[January 14, 2026, 10:32:05 pm]
TSpeedButton qt6 styleshe...
by
big_M
[January 14, 2026, 04:53:29 pm]
How to prevent onDropFile...
by
Hansaplast
[January 14, 2026, 04:51:23 pm]
Linked List Using Two Cla...
by
Thaddy
[January 14, 2026, 03:39:08 pm]
unit init, finalize and i...
by
Zvoni
[January 14, 2026, 02:48:57 pm]
Locate current record aft...
by
Zvoni
[January 14, 2026, 09:59:08 am]
Drag and Drop Files; onDr...
by
Hansaplast
[January 14, 2026, 09:39:25 am]
Lazarus and Libre Office
by
MarkMLl
[January 14, 2026, 09:22:14 am]
scat bikes (inc)
by
speter
[January 14, 2026, 04:38:11 am]
Effect of adding properti...
by
n7800
[January 14, 2026, 04:13:36 am]
solution for installing F...
by
BradleySlavik
[January 14, 2026, 02:37:22 am]
What was your first compu...
by
CM630
[January 13, 2026, 10:09:19 pm]
Dragging files to .app no...
by
Boleeman
[January 13, 2026, 10:06:09 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [RESOLVED] FileMode and multi-thread (Read 6685 times)
bubulemaster
New Member
Posts: 47
[RESOLVED] FileMode and multi-thread
«
on:
February 05, 2010, 11:00:54 am »
Hi,
I just want know if FileMode variable is multi-thread safe or if I must use critical section.
I found nothing about this.
Thanks
«
Last Edit: February 07, 2010, 05:53:47 pm by bubulemaster
»
Logged
http://www.bubulemaster.fr
Jonas Maebe
Hero Member
Posts: 1071
Re: FileMode and multi-thread
«
Reply #1 on:
February 05, 2010, 01:02:17 pm »
Quote from: bubulemaster on February 05, 2010, 11:00:54 am
I just want know if FileMode variable is multi-thread safe or if I must use critical section.
It is not thread safe. You can use a critical section, but in the long run it's probably better to use the routines from sysutils instead (
http://www.freepascal.org/docs-html/rtl/sysutils/fileopen.html
and friends)
Logged
bubulemaster
New Member
Posts: 47
Re: FileMode and multi-thread
«
Reply #2 on:
February 05, 2010, 04:20:57 pm »
Yes, but these routines map to the Windows (or Linux) API functions and return file handles, not normal Pascal file variables. No ?
Logged
http://www.bubulemaster.fr
Jonas Maebe
Hero Member
Posts: 1071
Re: FileMode and multi-thread
«
Reply #3 on:
February 05, 2010, 04:23:30 pm »
Indeed.
Logged
mattias
Administrator
Full Member
Posts: 206
Re: FileMode and multi-thread
«
Reply #4 on:
February 06, 2010, 03:07:53 am »
Use TFileStream instead. It's simple once you get used to it, can be combined with lots of other stream classes (zip, memory), is thread safe and platform independently.
Logged
bubulemaster
New Member
Posts: 47
Re: FileMode and multi-thread
«
Reply #5 on:
February 07, 2010, 05:53:34 pm »
TFileStream is good idea ! Thanks
Logged
http://www.bubulemaster.fr
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
[RESOLVED] FileMode and multi-thread
TinyPortal
© 2005-2018