Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #1532 > unrolled thread

Re: SemCondvar version 1.1...

Started byMelzzzzz <mel@zzzzz.com>
First post2013-06-14 01:47 +0200
Last post2013-06-14 02:56 +0200
Articles 5 — 1 participant

Back to article view | Back to comp.programming.threads

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: SemCondvar version 1.1... Melzzzzz <mel@zzzzz.com> - 2013-06-14 01:47 +0200
    Re: SemCondvar version 1.1... Melzzzzz <mel@zzzzz.com> - 2013-06-14 02:12 +0200
      Re: SemCondvar version 1.1... Melzzzzz <mel@zzzzz.com> - 2013-06-14 02:20 +0200
        Re: SemCondvar version 1.1... Melzzzzz <mel@zzzzz.com> - 2013-06-14 02:40 +0200
        Re: SemCondvar version 1.1... Melzzzzz <mel@zzzzz.com> - 2013-06-14 02:56 +0200

#1532 — Re: SemCondvar version 1.1...

FromMelzzzzz <mel@zzzzz.com>
Date2013-06-14 01:47 +0200
SubjectRe: SemCondvar version 1.1...
Message-ID<kpdllo$nra$21@news.albasani.net>
On Thu, 13 Jun 2013 19:43:59 -0700
aminer <aminer@toto.net> wrote:

> 
> Hello,
> 
> I have updated SemaCondvar to version 1.1, now it supports ALL the 
> charateristics of a semaphore and a condition variable,
> i have also corrected a bug.
> 
> Description: SemaCondvar and SemaMonitor are new and portable 
> synchronization objects that combine all the characteristics of a 
> semaphore and a condition variable, they only use an event object and
> a critical section, so they are fast.

Portable to pascal, windows?

> 
> 
> 
> 

[toc] | [next] | [standalone]


#1535

FromMelzzzzz <mel@zzzzz.com>
Date2013-06-14 02:12 +0200
Message-ID<kpdn55$2cd$1@news.albasani.net>
In reply to#1532
On Thu, 13 Jun 2013 19:55:46 -0700
aminer <aminer@toto.net> wrote:

> On 6/13/2013 4:47 PM, Melzzzzz wrote:
> > On Thu, 13 Jun 2013 19:43:59 -0700
> > aminer <aminer@toto.net> wrote:
> >
> >>
> >> Hello,
> >>
> >> I have updated SemaCondvar to version 1.1, now it supports ALL the
> >> charateristics of a semaphore and a condition variable,
> >> i have also corrected a bug.
> >>
> >> Description: SemaCondvar and SemaMonitor are new and portable
> >> synchronization objects that combine all the characteristics of a
> >> semaphore and a condition variable, they only use an event object
> >> and a critical section, so they are fast.
> >
> > Portable to pascal, windows?
> >
> >>
> >>
> >>
> >>
> >
> >
> 
> 
> It's portable to Windows 32 , Windows 64 , Linux 32 and 64, MacOSX, 
> Sparc OSs and iOS, for this you have to compile it with Freepascal or 
> Delphi XE4.
> 

bmaxa@maxa:~/examples/aminer$ fpc -CD SemaCondvar.pas
Free Pascal Compiler version 2.6.0-9 [2013/04/16] for x86_64
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling SemaCondvar.pas
SemaCondvar.pas(29,10) Error: Duplicate identifier "SYSTEM"
SemaCondvar.pas(29,10) Fatal: Syntax error, ";" expected but "." found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)


> If you want to port it to C++ , just read the Object pascal source
> code and translate it to C++, that's not so difficult.

Well, it is not useful to port it to C++. C would be much more useful,
as all languages (including assembler) interface C easily.

> 
> 
> Thank you,
> Amine Moulay Ramdane.

You are welcome ;)

> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#1537

FromMelzzzzz <mel@zzzzz.com>
Date2013-06-14 02:20 +0200
Message-ID<kpdnjp$2cd$2@news.albasani.net>
In reply to#1535
On Thu, 13 Jun 2013 20:16:16 -0700
aminer <aminer@toto.net> wrote:

> 
> 
> Please download the right version for FreePascal, not the one for
> Delphi XE4.
> 
> http://pages.videotron.com/aminer/

I think that you didn't put version for freepascal.
Both files are same.

> 
> 
> Thank you,
> Amine Moulay Ramdane.
> 

You are welcome ;)

> 
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#1541

FromMelzzzzz <mel@zzzzz.com>
Date2013-06-14 02:40 +0200
Message-ID<kpdoqb$2cd$3@news.albasani.net>
In reply to#1537
On Thu, 13 Jun 2013 20:26:14 -0700
aminer <aminer@toto.net> wrote:

> On 6/13/2013 5:20 PM, Melzzzzz wrote:
> > On Thu, 13 Jun 2013 20:16:16 -0700
> > aminer <aminer@toto.net> wrote:
> >
> >>
> >>
> >> Please download the right version for FreePascal, not the one for
> >> Delphi XE4.
> >>
> >> http://pages.videotron.com/aminer/
> >
> > I think that you didn't put version for freepascal.
> > Both files are same.
> >
> >>
> >>
> >> Thank you,
> >> Amine Moulay Ramdane.
> >>
> >
> > You are welcome ;)
> >
> >>
> >>
> >>
> >>
> >
> >
> 

bmaxa@maxa:~/examples/aminer$ fpc  -O3 -Sd -dFPC -dFreePascal SemaCondvar.pas
Free Pascal Compiler version 2.6.0-9 [2013/04/16] for x86_64
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling SemaCondvar.pas
SemaCondvar.pas(136,7) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(158,12) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(198,14) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(230,16) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(300,30) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(326,30) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(241,7) Note: Local variable "b" not used
SemaCondvar.pas(377,7) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(396,12) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(436,14) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(468,16) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(540,30) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(567,30) Warning: use extended syntax of NEW and DISPOSE for instances of objects
SemaCondvar.pas(481,7) Note: Local variable "b" not used
586 lines compiled, 0.0 sec 
12 warning(s) issued
2 note(s) issued
bmaxa@maxa:~/examples/aminer$ fpc  -O3 -Sd -dFPC -dFreePascal test.pas
Free Pascal Compiler version 2.6.0-9 [2013/04/16] for x86_64
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
test.pas(44,1) Note: Local variable "thread1" is assigned but never used
test.pas(45,1) Note: Local variable "thread2" is assigned but never used
test.pas(46,1) Note: Local variable "thread3" is assigned but never used
test.pas(47,1) Note: Local variable "thread4" is assigned but never used
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
127 lines compiled, 0.1 sec 
4 note(s) issued
bmaxa@maxa:~/examples/aminer$ ./test
Type any key to signal the threads...

Thread3 signaled !
Thread1 signaled !
Thread2 signaled !
Thread4 signaled !
Number of waiters blocked is: 0



> 
> Please download again the FreePasal version , i have just changed 
> changed the link to point to the right version.
> 
> 
> http://pages.videotron.com/aminer/

Seems it is working now. I had to install lazarus beside fpc.

[toc] | [prev] | [next] | [standalone]


#1543

FromMelzzzzz <mel@zzzzz.com>
Date2013-06-14 02:56 +0200
Message-ID<kpdpoa$2cd$4@news.albasani.net>
In reply to#1537
On Thu, 13 Jun 2013 20:34:00 -0700
aminer <aminer@toto.net> wrote:

> 
> 
> 
> I am using a Critical Section and and manual reset Event.
> 
> I think that's fast enough.

Well,  on Linux, condition vars and semaphores are implemented
in terms of futex, http://en.wikipedia.org/wiki/Futex  (and spin locks,
I guess), as this is low level syscall.
Critical Section and Event, sounds like Windows. This is probably
implemented in Lazarus in terms of Linux constructs
(mutexes,condvars/semaphores).

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming.threads


csiph-web