[fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Brian
Mark ... many thanks. Your last comment prompted me to avoid using Write/Writeln to monitor what was happening. By removing Write/Writeln from the threads , ... everything works correctly with two threads , one running on core1 and the other thread running on core2. I think this boils down to the

Re: [fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Mark Morgan Lloyd
Brian wrote: "... The critical sections you are using only protect each thread against itself, meaning they basically do nothing. Being inside a critical section is not a guarantee that you won't get preempted, but just that no other threads can enter the same section. ..." The two threads do no

[fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Brian
"... The critical sections you are using only protect each thread against itself, meaning they basically do nothing. Being inside a critical section is not a guarantee that you won't get preempted, but just that no other threads can enter the same section. ..." The two threads do not share and var

Re: [fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Sven Barth
Am 22.11.2013 19:17 schrieb "Jeppe Græsdal Johansen" : > Your code is broken. > > You are using the console output from two threads simultaneously without proper locking. That's most likely what's causing the crash. (Disclaimer: I haven't looked at the code, so I'm just assuming that he's using Wr

Re: [fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Jeppe Græsdal Johansen
Den 22-11-2013 16:21, Brian skrev: Mark ... sorry for the mixup. The program and unit should now be stand alone. The unit links libc (rev6). Regards Brian coret.pas test_threads.pas

Re: [fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Mark Morgan Lloyd
Brian wrote: Mark ... sorry for the mixup. The program and unit should now be stand alone. The unit links libc (rev6). Regards Brian coret.pas test_threads.pas

[fpc-pascal] Re: Is the GIT repository updated?

2013-11-22 Thread leledumbo
That repo is maintained by Graeme and seems like it doesn't have autosync feature, so it's up to Graeme when to synchronize with main repository (svn). -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Is-the-GIT-repository-updated-tp5717545p5717551.html Sent fro

[fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Brian
Attached binary executables which run on Ubuntu 12.04lts , but should be portable. coret_ok sets the process and two threads to core1 coret_fail sets to process to cores1 and 2 , one thread to core 1 and one thread to core 2. It soemtimes runs ok , but usually fails with a GP fault. coret_ok

[fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Brian
Mark ... sorry for the mixup. The program and unit should now be stand alone. The unit links libc (rev6). Regards Brian coret.pas test_threads.pas

Re: [fpc-pascal] Double and LongWord

2013-11-22 Thread Jonas Maebe
On 22 Nov 2013, at 10:56, Carsten Bager wrote: This Function works on Intel platforms but when compiled to Arm (Linux) the right side is calculated as a LongWord. Const cSecondsPerDay=86400.0; cTimeDate2UnixFiledateStart=25569.0; cUnixFileDateDateTimeStart=cSecondsPerDay*cTimeDate2UnixF

[fpc-pascal] Double and LongWord

2013-11-22 Thread Carsten Bager
Hi This Function works on Intel platforms but when compiled to Arm (Linux) the right side is calculated as a LongWord. Const cSecondsPerDay=86400.0; cTimeDate2UnixFiledateStart=25569.0; cUnixFileDateDateTimeStart=cSecondsPerDay*cTimeDate2UnixFiledateStart; Function UnPackUnixTime2DateTime

Re: [fpc-pascal] Re: GetAffinity\SetAffinity

2013-11-22 Thread Mark Morgan Lloyd
Brian wrote: Attached is a simple test program with two threads. When the threads run , one displays '+' and the other displays '2'. If both threads run on the same core , the threads work , but if the threads are set to different cores , it generates a GP fault. If anyone is interested , downl