Forum > Free Pascal

FPC 3.2.x series branched, trunk update to 3.3.1

<< < (3/41) > >>

Martin_fr:

--- Quote from: Martin_fr on August 19, 2018, 01:36:59 am ---For Windows users: https://sourceforge.net/projects/lazarus-snapshots/files/

Ensure to set the checkbox "secondary installation", then they do not interfere with your stable install.

--- End quote ---
I uploaded up to date 3.2.0-beta installers for windows, bundled with Lazarus 2.0RC1

Note: Lazarus 2.0RC1 will be released with 3.0.4, but some Lazarus 2.0.x will probably switch to 3.2. So better test both combinations.

Soner:
It seems that something with the IsMultiThread variable changed.

Look my comments in the example from lazarus/examples/multithreading (you must add this lines and one Tlabel).


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.FormCreate(Sender: TObject);begin   // IsMultiThread is here with  with fpc 3.0.4 true and with fpc 3.2.0 false  if IsMultiThread then  Label1.Caption:=' Yes _ IsMultiThread='+Ord(IsMultiThread).ToString  else  Label1.Caption:=' No _ IsMultiThread='+Ord(IsMultiThread).ToString;   // ... end;       procedure TMyThread.Execute;begin    // HERE IsMultiThread for both true    newStatus:='TMyThread Time: '+FormatDateTime('YYYY-MM-DD HH:NN:SS',Now)+' _ IsMultiThread='+Ord(IsMultiThread).ToString;   end; 
This is only information for fpc-developer.  I don't know if is it bug or new feature.
I never used multithreading on fpc, I detected it as I look some examples here:
http://forum.lazarus-ide.org/index.php/topic,43005.msg301598
Maybe you should put this on your changed list, so the developer can change their code.

This is my lazaurs and fpc version
Lazarus Svn 2.1.0 r59470 (from 6.11.2018)
Fpc 3.2.0  r40279 (from today https://svn.freepascal.org/svn/fpc/branches/fixes_3_2/)
All 32Bit on Windows 10 64Bit.

I compile fpc 3.2.0.r59470 with fpc 3.2.0.r39795 from 2018/9/23

marcov:

--- Quote from: Soner on November 09, 2018, 05:38:55 pm ---It seems that something with the IsMultiThread variable changed.

--- End quote ---

You mean different from the documented behaviour?


Soner:
@marco
I don't know anything about multithreading and IsMultiThread variable in fpc.
I wanted only inform the developers and users of fpc.
In example from above and in ibx-examples with fpc 3.0.2 IsMultiThread is in OnFormCreate true but with fpc 3.2.0. it is false.

When this normal is then it is okay.
According to documentation the behavior in version 3.2.0 is more correct.
Maybe you should write in fpc 3.2.0 release notes something like "IsMultiThreads value is more accurate now", to inform the developers.

Edit 1:
Maybe Toni (author of ibx) and others need a variable like IsMultiThreadSupported.
After reading the documentation and thinking about, I must say the behavior in 3.0.2 is wrong.

Thaddy:
Note the behavior on different platforms is slightly different (has always been the case).
- On unixes (Posix), IsMultiThread is set when you include cthreads in the uses clause, assuming that if you include a threadmanager it is your intention to have a multithreaded application..
- On Windows, IsMultiThread is set when a thread is actually used (except from the bare Windows API functions, you need to set IsMultiThread by hand). For Windows there is a minimal Threadmanager included in the system unit.
- On other platforms it may vary
These differences are wholly caused by the differences in the underlying OS.
The specific behavior is mainly documented in the sources but the above is also documented in the official documentation.
See https://www.freepascal.org/docs-html/current/prog/progch10.html#progse43.html

Note that currently some work is going on in trunk related to thread local storage and as always implementation details need not be documented if there are no side effects.

In general don't assume anything about threading internals and don't assume the behavior is equivalent to e.g. Delphi.
And more broadly speaking I am one of those people that believe that a programmer that uses threading requires a license. Relatively few people qualify.....in any language...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version