Recent

Author Topic: real case test MM parallel 4x scalable (i7 6700)  (Read 11305 times)

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #15 on: July 27, 2017, 05:59:40 pm »
@bobdp

I am actually wondering...

in the word 'threadvar', what word do you not understand ?  :D

https://en.wikipedia.org/wiki/Thread-local_storage#Object_Pascal

generics are TYPES, templates, you can use them in TLS with threadvar variables LOL
« Last Edit: July 27, 2017, 06:01:22 pm by sam707 »

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #16 on: July 27, 2017, 06:01:34 pm »
threadvars are 44 time slower that normal vars :) tested 2 months ago
Speak postscript or die!
Translate to pdf and live!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #17 on: July 27, 2017, 06:07:42 pm »
threadvars are 44 time slower that normal vars :) tested 2 months ago

(meaningless without OS info)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #18 on: July 27, 2017, 06:08:42 pm »
win 10 and debian 8.4 32 bits
Speak postscript or die!
Translate to pdf and live!

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #19 on: July 27, 2017, 06:15:02 pm »
lemme open another chinese biscuit of wisedom  :D
threadvar IS THE ONLY WAY to access TLS in a crossplatform compiler unless you are an asm God knowing ALL the assembly langs AND TRICKS for each targeted cpu /OSes

@Marcov +10 as usually

to delphiSHOP it doesn't matter since kylix death
« Last Edit: July 27, 2017, 06:22:15 pm by sam707 »

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #20 on: July 27, 2017, 06:49:30 pm »
im not against tls im a huge fan of the "share nothing" concept im just saying that accesing tls is not cheap... its better to allocate a big steucture in tls and ro get a pointer to. it once and then use all the vars in that steucture through this pointer
Speak postscript or die!
Translate to pdf and live!

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #21 on: July 27, 2017, 06:56:50 pm »
Begin // off topic

  @sam707, @Blestan

  The 'better' depends on how you define it. If you mean cheaper,
  yes GIMP if better because it is free.

  But if you mean feature by feature comparison and/or easier to use,
  Photoshop is better. If you find some reviewers who say GIMP is better,
  that because they are OSS supporters, casual users, novice graphics
  editors, non-profesional graphics designers.

  Also MsPaint and LazPaint are better than GIMP if you just need it to do
  some simple image resizing, cropping and text adding. It's just discussed   
  here: http://forum.lazarus.freepascal.org/index.php/topic,37670.0.html

  I used Photoshop from 2004 - 2009, started to use GIMP from 2008 -
  now. You can be a professional Photoshop user just in less than a year
  of serious learning, you can be similar skill level in GIMP only after years
  of intensive using/learning it. Not because GIMP has more features but
  because working in Photoshop is more intuitive than in GIMP.

  All the things you can do in Photoshop can also be done in GIMP. But
  if you are a master in Photoshop you can do it lots faster in Photoshop.
  I can show you a long list of features that Photoshop has but GIMP don't.
  But I think no one here will be interested to know. So I stop here.

  // I'm a non-biased user

End.



sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #22 on: July 27, 2017, 07:03:00 pm »
im actually writing a thread and I use its stack intensively so IF i need to create multiple instances of that thread object, each one is going to swim in its own STACK. the concept I follow comes from pascal-80 because in the early days of pascal, programmers (like me) were used to use big amount of the STACK (it was known as a 'pascal POWER' against other languages like basic. kinda 'stack being a local heap'

anyway, what basically do a CPU (monocore) when it switches to ANY thread?

1) save registers from the actual thread (running 'CONTEXT')

2) load registers from 'CONTEXT' to be run

3) execute CONTEXT for a time period

4) go to 1)

So without deep Knowing assembler langs and particular TRICKS you WONT be able to accelerate the 'SWITCHING PASS 1) & 2) & 4)'
« Last Edit: July 27, 2017, 07:52:13 pm by sam707 »

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #23 on: July 27, 2017, 07:09:19 pm »
in multicore world, it's almost same, except that 1 thread per core 'can' stay switched and execute

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #24 on: July 27, 2017, 09:17:18 pm »
Please don't compare PHOTOSHOP with GIMP, I see and hear it all the time and it's nonsense!
PHOTOSHOP = 2D, 3D, VIDEO Editing, Automation without knowing a script language
GIMP = 2D
It's like comparing LibreOffice with FreePascal Standard IDE...  >:D (WTF)  :D

Every PRO knows... if you need real quality in all fields then you need GIMP AND PHOTOSHOP !!!
Why?
With PHOTOSHOP you cannot paint photos, yes I mean photos not pictures... Yes, BIG DIFFERENCE !!!
I know a lot of guys out there think if you want a photo then you always need a camera... NO!
 
I've tried PS 15.2.2 and 17.0.1, but it's still not possible... probably never ever...  8-)  (Maybe they have a very powerful HIDING MECHANISM...)
It has to do with ColorFields-Marker, Key assignment, ColorPicker, adding new colors quickly...
And the same technique can be used to edit photos at a very high end level, yes only with GIMP !!!
On the other side... nobody really wants to give up CAMERA RAW or LAYER STYLES...

Sorry guys, but I couldn't help myself...  :D :D :D
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #25 on: July 28, 2017, 12:02:47 am »
@RAW +10

for some reasons I was living next to the team working on the 1st shrek movies, so I meet some of them at restaurant AND they just told me that they did works on the movie with the Gimp that NO photoSHOP pro could do...

That is only what i said HERE, NO LESS, NO MORE! to ease a comparaison between FREElaz and delphiSHOP!

I don't know why some people are flaming all around with MY ONLY FACTS repported.

they can continue flaming 'offtopic' craps, the earth is not gonna become cubic
 :D :D :D :D :D :D :D :D :D

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #26 on: July 28, 2017, 12:10:22 am »
wise man shows the moonlight, a wagon of idiots inspects his finger HAHAHAHA

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #27 on: July 28, 2017, 09:00:36 am »
threadvars are 44 time slower that normal vars :) tested 2 months ago
I believe I also explained two months ago that is not the case. Within a thread the threadvar has the same speed as a var in the main thread. It is accessing it from another thread, like the main thread, that makes it look slow.
But that is to be expected. It also depends on OS and it also depends on the type of var.
What I do agree with is that there is room from improvement regarding synchronized access to more complex threadvars. Delphi seems to do a better job on Windows32-Intel.

You can also mitigate it, by using simple (simpler) synchronization primitives on a global var depending on application.

Note I wish the topic could stay on topic: speeding up the memory manager. Roberto did a great job for Delphi. We probably can learn from it and apply some of it for Windows-Intel and even some of the algorithmic stuff cross-platform.
« Last Edit: July 28, 2017, 09:07:59 am by Thaddy »
Specialize a type, not a var.

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #28 on: July 28, 2017, 10:26:52 am »
I also use the share nothing method, and use Windows messages and sockets for communication. But that's a lot of work.

sam707

  • Guest
Re: real case test MM parallel 4x scalable (i7 6700)
« Reply #29 on: July 28, 2017, 04:34:44 pm »
1) I use stack (each thead has its own) and my OBJECTs instead of classes for that purpose (init and done constructors), in the redefined TThread.Execute, with a stack size i usually set to 15% more than needed by stacks vars + 16Ko when gdb is running. It works perfect, so far

2) for interthreads communication I simply use the encapsulation mechanism of classes (private, protected, public) it is enough most of the time! (when other theads are just reading data) In particular cases when really really (i mean really) needed, I use TEvent & TCriticalSection(s) that are threads bottlenecks= 1 active thread only per critical code section 'aquired', the others on sleep mode waiting for the criticalsection(s).Release

Code: Pascal  [Select][+][-]
  1. {$IFDEF NODEBUGTHREAD}
  2. const
  3.   THREADSTACK = $2000;
  4.  
  5. {$ELSE}
  6. const
  7.   THREADSTACK = $10000; (* gdb need space *)
  8.  
  9. {$ENDIF}
« Last Edit: July 28, 2017, 04:50:32 pm by sam707 »

 

TinyPortal © 2005-2018