Re: [fpc-pascal] Threading vs Parallelism ?

2017-05-09 Thread Brian
I should have said "streaming" rather than "serial". True Parallelism is a long way off in the future , but a form of parallelism can be had using multiple CPU cores and hard affinity as described in the excellent article.

Re: [fpc-pascal] Threading vs Parallelism ?

2017-05-07 Thread noreply
On 2017-05-05 14:27, Brian wrote: Affinity If a thread is dedicated to say , polling a serial or Ethernet port which has a high input data rate , then dedicating one CPU to that task/thread is useful. Isn't the speed of serial (so slow) that it would be overkill to dedicate a Cpu to it?

Re: [fpc-pascal] Threading vs Parallelism ?

2017-05-06 Thread Brian
The information about using affinity with Linux was only posted so anyone who was interested could use it , and was not intended as an addition to Free Pascal. Regrading the previous comment about the hardware buffering the data , one still must do something with the data in user space. The

Re: [fpc-pascal] Threading vs Parallelism ?

2017-05-05 Thread Marco van de Voort
In our previous episode, Brian said: > Affinity > > If a thread is dedicated to say , polling a serial or Ethernet port which > has a high input data rate , then dedicating one CPU to that task/thread is > useful. Well, the driver actually does the hardware, so it is already buffered for

Re: [fpc-pascal] Threading vs Parallelism ?

2017-05-05 Thread Brian
Affinity If a thread is dedicated to say , polling a serial or Ethernet port which has a high input data rate , then dedicating one CPU to that task/thread is useful. (Hard Affinity) with multi-core CPU's is to dedicate a specific core to a task (thread) and just poll the input memory mapped

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Mark Morgan Lloyd
On 20/04/17 10:22, Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said:> > They are not really threads. They must be scheduled within threads.> > https://msdn.microsoft.com/en-us/library/windows/desktop/ms682661(v=vs.85).aspx> > from the article they don't seem to have

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > > They are not really threads. They must be scheduled within threads. > > https://msdn.microsoft.com/en-us/library/windows/desktop/ms682661(v=vs.85).aspx > > from the article they don't seem to have that many advantages, except > > toconvert

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Mark Morgan Lloyd
On 20/04/17 09:00, Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said:> > In any event, processes on unix are *defined* as owning resources- > memory, handles and so on- while threads only manage control flow. I > believe that MS also have "fibers" which are

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > > In any event, processes on unix are *defined* as owning resources- > memory, handles and so on- while threads only manage control flow. I > believe that MS also have "fibers" which are non-preemptive threads. They are not really threads.

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Mark Morgan Lloyd
On 20/04/17 07:00, Michael Schnell wrote: Again (AFAIK) NPTL had not been introduce to make threads "lighter" but to allow for threads behaving in a decently POSIX compatible way (e.g. the threads of a process getting only a common share of time slices). In any event, processes on unix are

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-20 Thread Michael Schnell
On 14.04.2017 09:36, Sven Barth via fpc-pascal wrote: A process definitely is less "light" than threads even on Unix systems: a process has its own address space Not really true (see below). Why do you think the concept of threads was introduced in Unix? Early Unix systems only had

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-14 Thread Sven Barth via fpc-pascal
Am 14.04.2017 09:23 schrieb "Michael Schnell" : > > On 12.04.2017 14:09, Lars wrote: >> >> If unix could just make processes even lighter weight or >> faster loading, I might avoid threads and just use processes... > > in Unix/Linux processes are not less "light" then threads.

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-14 Thread Michael Schnell
On 12.04.2017 14:09, Lars wrote: If unix could just make processes even lighter weight or faster loading, I might avoid threads and just use processes... in Unix/Linux processes are not less "light" then threads. You can create a process by "fork". no "Loading" involved. it just creates the

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread noreply
On 2017-03-30 11:29, Jon Foster wrote: On 03/29/2017 01:15 PM, Michael Van Canneyt wrote: On Wed, 29 Mar 2017, Dimitrios Chr. Ioannidis via fpc-pascal wrote: Hi, On 29/3/2017 9:57 μμ, fredvs wrote: Hello. Some developers treat me as dinosaur because I use threads in place of doing

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Giuliano Colla
Il 30/03/2017 00:26, fredvs ha scritto: Perfect, I have now all the arguments to defend the "Dinosaur Threading" choice. When I'm charged of not using the most cool and new technology, my favourite argument are the tombstones. They're made out of stone, which is a stone-age technology. But,

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lars
On Thu, March 30, 2017 1:56 am, Mark Morgan Lloyd wrote: > On 29/03/17 22:30, fredvs wrote: > >> @Karoly Balogh (Charlie/SGR) >> Perfect, I have now all the arguments to defend the "Dinosaur >> Threading"choice. >> Thanks. >> > > I'd second Charlie's point, and add that a very small change to a >

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lars
On Wed, March 29, 2017 4:26 pm, fredvs wrote: > @Karoly Balogh (Charlie/SGR) > > > Perfect, I have now all the arguments to defend the "Dinosaur Threading" > choice. > > Thanks. > > > Fre;D > Methinks that programs should be designed or programmed in such an abstract way that you do not care or

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-01 Thread Gary Doades
>> On Mar 31, 2017, at 5:32 PM, Michael Schnell wrote: >> >> Regarding the view of the application (disregarding execution speed) or of >> the application programmer, there is no difference between real ("Hardware") >> and virtual (e.g. threads) parallelism. These dirty

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-01 Thread Ryan Joseph
> On Mar 31, 2017, at 5:32 PM, Michael Schnell wrote: > > Regarding the view of the application (disregarding execution speed) or of > the application programmer, there is no difference between real ("Hardware") > and virtual (e.g. threads) parallelism. These dirty basics

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-01 Thread Michael Schnell
On 31.03.2017 10:18, Tony Whyman wrote: Neither of the above implies multiple CPUs or processing units. Regarding the view of the application (disregarding execution speed) or of the application programmer, there is no difference between real ("Hardware") and virtual (e.g. threads)

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-01 Thread Michael Schnell
On 30.03.2017 18:29, Jon Foster wrote: I say threading is parallelism, even if just one form of it. The other methods of parallelism I mentioned here could also be done in FPC with the appropriate code. Threading is the way parallelism can be achieved using a "standard" programming language

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
> On Mar 31, 2017, at 3:55 PM, Gary Doades wrote: > > However, multiple independent compute units must be required for *true* > parallelism. On a single processor any tasks running at the same time is just > an illusion, normally created by the OS in time slicing between

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
> On Mar 31, 2017, at 4:38 PM, Tony Whyman > wrote: > > For example, this distinction is very important in matrix algorithms. When > operating on two matrices to produce another, the operations on each cell can > be identified as n x m parallel actions at

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Tony Whyman
On 31/03/17 09:55, Gary Doades wrote: However, multiple independent compute units must be required for*true* parallelism. On a single processor any tasks running at the same time is just an illusion, normally created by the OS in time slicing between tasks based on certain criteria

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Gary Doades
> I would offer the following definitions: > - Parallelism is a (design) concept for expressing collateral actions in > which the processing order of the actions is unspecified. They may take place > serially or > contemporaneously in real time, or a mixture of the two. > - Threads are an

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Tony Whyman
The problem I have with this thread (no pun intended) is that it is not comparing like with like. As demonstrated by many of the replies, Parallelism and Threads are not the same thing. I would offer the following definitions: - Parallelism is a (design) concept for expressing collateral

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
> On Mar 30, 2017, at 3:06 PM, Michael Schnell wrote: > >> >> Huh, ok, but why parallelism is better and how to do it with fpc ? >> > Parallelism within a process always is based on threads. > > AFAIK, fpc does not (yet) provide a more convenient abstraction for >

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Michael Schnell
On 29.03.2017 20:57, fredvs wrote: Huh, ok, but why parallelism is better and how to do it with fpc ? Parallelism within a process always is based on threads. AFAIK, fpc does not (yet) provide a more convenient abstraction for parallelism (such as parallel loops) than TThread. -Michael

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-30 Thread Jon Foster
On 03/29/2017 01:15 PM, Michael Van Canneyt wrote: On Wed, 29 Mar 2017, Dimitrios Chr. Ioannidis via fpc-pascal wrote: Hi, On 29/3/2017 9:57 μμ, fredvs wrote: Hello. Some developers treat me as dinosaur because I use threads in place of doing parallelism. Huh, ok, but why parallelism

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-30 Thread Mark Morgan Lloyd
On 30/03/17 08:00, Mark Morgan Lloyd wrote: Finally, I suggest that you look at least briefly at https://en.wikipedia.org/wiki/Vector_Pascal which appears to have some quite good stuff in it. Quoting from manual section 5.4. Future machines like the Larrabee will have considerably wider SIMD

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-30 Thread Mark Morgan Lloyd
On 29/03/17 22:30, fredvs wrote: @Karoly Balogh (Charlie/SGR) Perfect, I have now all the arguments to defend the "Dinosaur Threading"choice. Thanks. I'd second Charlie's point, and add that a very small change to a system's layout, e.g. a DIMM on a NUMA node going dodgy and being excluded

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Ryan Joseph
> On Mar 30, 2017, at 4:25 AM, fredvs wrote: > >> >> how software parallelism ( in the sense of true simultaneous execution ) >> in a single process without using ( OS dependent ) threads can be achieved >> ? > > Huh, it is exactly was I do not understand... Look at an

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Ryan Gonzalez
Parallelism is what hipster Node programmers do, threads are everything else. /jk -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On Mar 29, 2017 1:57 PM, "fredvs" wrote: > Hello. > > Some developers treat me as

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread fredvs
@Karoly Balogh (Charlie/SGR) Perfect, I have now all the arguments to defend the "Dinosaur Threading" choice. Thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Threading-vs-Parallelism-tp5728018p5728025.html Sent from the

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Karoly Balogh (Charlie/SGR)
Hi, On Wed, 29 Mar 2017, fredvs wrote: > > besides hardware parallelism, > > Is it possible, with fpc, to assign one processor (if multi) for a > thread and say to the system to use this one only for the thread ? But > maybe it will gives more problems than solutions. Yes, it's called

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread fredvs
> besides hardware parallelism, Is it possible, with fpc, to assign one processor (if multi) for a thread and say to the system to use this one only for the thread ? But maybe it will gives more problems than solutions. Fre;D - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread fredvs
> I would not pay too much attention to what these developers are saying. Excellent idea, I will do the same ;-) > how software parallelism ( in the sense of true simultaneous execution ) > in a single process without using ( OS dependent ) threads can be achieved > ? Huh, it is exactly was

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, On 29/3/2017 11:15 μμ, Michael Van Canneyt wrote: < snip > Showing nicely that parallelism in a single process implies threads. I would not pay too much attention to what these developers are saying. besides hardware parallelism, how software parallelism ( in the sense of true

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Michael Van Canneyt
On Wed, 29 Mar 2017, Dimitrios Chr. Ioannidis via fpc-pascal wrote: Hi, On 29/3/2017 9:57 μμ, fredvs wrote: Hello. Some developers treat me as dinosaur because I use threads in place of doing parallelism. Huh, ok, but why parallelism is better and how to do it with fpc ? a nice

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Dimitrios Chr. Ioannidis via fpc-pascal
Hi, On 29/3/2017 9:57 μμ, fredvs wrote: Hello. Some developers treat me as dinosaur because I use threads in place of doing parallelism. Huh, ok, but why parallelism is better and how to do it with fpc ? a nice article I've found long ago when I was researching the same topic

[fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread fredvs
Hello. Some developers treat me as dinosaur because I use threads in place of doing parallelism. Huh, ok, but why parallelism is better and how to do it with fpc ? Thanks. Fre;D - Many thanks ;-) -- View this message in context: