http://groups.google.com/group/comp.programming.threads?hl=en
comp.programming.threads@googlegroups.com
Today's topics:
* Lock Free Data Structure - 9 messages, 2 authors
http://groups.google.com/group/comp.programming.threads/t/9fc66e51366be90f?hl=en
* correct use of mfence - 6 messages, 2 authors
http://groups.google.com/group/comp.programming.threads/t/8931f6ece032d2d1?hl=en
* threads and log - 8 messages, 5 authors
http://groups.google.com/group/comp.programming.threads/t/3b3c208c958b241e?hl=en
* CFP with extended deadline of Mar. 11, 2009: WORLDCOMP'09 (The 2009 World
Congress in Computer Science, Computer Engineering, and Applied Computing),
USA, July 13-16, 2009 - 1 messages, 1 author
http://groups.google.com/group/comp.programming.threads/t/2b509e463f1901f0?hl=en
* Synchronising background streaming threads - 1 messages, 1 author
http://groups.google.com/group/comp.programming.threads/t/8188d6d8e25d219d?hl=en
==============================================================================
TOPIC: Lock Free Data Structure
http://groups.google.com/group/comp.programming.threads/t/9fc66e51366be90f?hl=en
==============================================================================
== 1 of 9 ==
Date: Fri, Feb 27 2009 11:56 pm
From: nithesh
Hi,
I am a beginner in lock free datastructure.. I have downloaded Appcore
source files from http://webpages.charter.net/appcore. appcore has
provided an asm file named ac_i686_masm.asm. This file gives following
compile time error::
ac_i686_atomic_inc_fence redefined
Platform used : Red Hat 3.4.3-9
In case if any one has used appcore please let me know how to compile
the asm file and create so file.
Please let me know other than appcore is there any other lock free
datastructure library available for linux.
Thanks,
Nithesh
== 2 of 9 ==
Date: Sat, Feb 28 2009 12:32 am
From: "Chris M. Thomasson"
"nithesh" <nithesh@gmail.com> wrote in message
news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
> Hi,
>
> I am a beginner in lock free datastructure.. I have downloaded Appcore
> source files from http://webpages.charter.net/appcore. appcore has
> provided an asm file named ac_i686_masm.asm. This file gives following
> compile time error::
> ac_i686_atomic_inc_fence redefined
> Platform used : Red Hat 3.4.3-9
> In case if any one has used appcore please let me know how to compile
> the asm file and create so file.
>
>
> Please let me know other than appcore is there any other lock free
> datastructure library available for Linux.
Are you compiling entire library? You on Linux right? Arte you using MingW?
Well, please correct me if I am wrong, but `ac_i686_masm.asm' is a Microsoft
specific file (MASM). I just assembled it with MASM on Windows. However,
IMVHO, this is meaningless to you; Okay:
Try assembling this single file with GAS right now:
http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_gcc_asm.html
Use common way to assemble using `AS' in the command line; simple. You need
to assemble this file into object file and link into main library.
You simply cannot use GAS to assembly Intel syntax library. Sorry about
that; well shi% happens. GAS expects AT&T. If your on Windows, try using GAS
with the following file:
http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_mingw_asm.html
Please, keep me informed. There might be several hour delays in my
responses, but I am here to help you.
Chris M. Thomasson.
== 3 of 9 ==
Date: Sat, Feb 28 2009 12:33 am
From: "Chris M. Thomasson"
"nithesh" <nithesh@gmail.com> wrote in message
news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
> Hi,
>
> I am a beginner in lock free datastructure.. I have downloaded Appcore
> source files from http://webpages.charter.net/appcore. appcore has
> provided an asm file named ac_i686_masm.asm. This file gives following
> compile time error::
> ac_i686_atomic_inc_fence redefined
> Platform used : Red Hat 3.4.3-9
> In case if any one has used appcore please let me know how to compile
> the asm file and create so file.
>
>
> Please let me know other than appcore is there any other lock free
> datastructure library available for linux.
Check here:
http://atomic-ptr-plus.sourceforge.net
== 4 of 9 ==
Date: Sat, Feb 28 2009 12:42 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:UC6ql.15747$l71.341@newsfe23.iad...
> "nithesh" <nithesh@gmail.com> wrote in message
> news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
>> Hi,
>>
>> I am a beginner in lock free datastructure.. I have downloaded Appcore
>> source files from http://webpages.charter.net/appcore. appcore has
>> provided an asm file named ac_i686_masm.asm. This file gives following
>> compile time error::
>> ac_i686_atomic_inc_fence redefined
>> Platform used : Red Hat 3.4.3-9
>> In case if any one has used appcore please let me know how to compile
>> the asm file and create so file.
>>
>>
>> Please let me know other than appcore is there any other lock free
>> datastructure library available for Linux.
>
> Are you compiling entire library? You on Linux right? Arte you using
> MingW? Well, please correct me if I am wrong, but `ac_i686_masm.asm' is a
> Microsoft specific file (MASM). I just assembled it with MASM on Windows.
> However, IMVHO, this is meaningless to you; Okay:
>
> Try assembling this single file with GAS right now:
>
> http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_gcc_asm.html
> [...]
>
>
> http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_mingw_asm.html
I just assemble the following with mingw:
http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_mingw_asm.html
works fine.
I just assemble:
http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_gcc_asm.html
works fine.
Please show me exact command line you using to assemble on Linux? I am very
interested.
== 5 of 9 ==
Date: Sat, Feb 28 2009 12:48 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:DM6ql.15755$l71.8457@newsfe23.iad...
> "Chris M. Thomasson" <no@spam.invalid> wrote in message
> news:UC6ql.15747$l71.341@newsfe23.iad...
>> "nithesh" <nithesh@gmail.com> wrote in message
>> news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
>>> Hi,
>>>
>>> I am a beginner in lock free datastructure.. I have downloaded Appcore
>>> source files from http://webpages.charter.net/appcore. appcore has
>>> provided an asm file named ac_i686_masm.asm. This file gives following
>>> compile time error::
>>> ac_i686_atomic_inc_fence redefined
>>> Platform used : Red Hat 3.4.3-9
>>> In case if any one has used appcore please let me know how to compile
>>> the asm file and create so file.
>>>
>>>
>>> Please let me know other than appcore is there any other lock free
>>> datastructure library available for Linux.
>>
>> Are you compiling entire library? You on Linux right? Arte you using
>> MingW? Well, please correct me if I am wrong, but `ac_i686_masm.asm' is a
>> Microsoft specific file (MASM). I just assembled it with MASM on Windows.
>> However, IMVHO, this is meaningless to you; Okay:
>>
>> Try assembling this single file with GAS right now:
>>
>> http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_gcc_asm.html
>> [...]
>>
>>
>> http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_mingw_asm.html
>
> I just assemble the following with mingw:
>
> http://webpages.charter.net/appcore/appcore/src/cpu/i686/ac_i686_mingw_asm.html
>
> works fine.
I also just assembled the file on Solaris (e.g. via GCC) and it works fine.
Please give me exact command line, and environment variables. I am most
interested. It should assemble in to object file just fine. What arch and
platform are you on?
== 6 of 9 ==
Date: Sat, Feb 28 2009 12:57 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:jE6ql.15751$l71.12453@newsfe23.iad...
> "nithesh" <nithesh@gmail.com> wrote in message
> news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
>> Hi,
>>
>> I am a beginner in lock free datastructure.. I have downloaded Appcore
>> source files from http://webpages.charter.net/appcore. appcore has
>> provided an asm file named ac_i686_masm.asm. This file gives following
>> compile time error::
>> ac_i686_atomic_inc_fence redefined
>> Platform used : Red Hat 3.4.3-9
>> In case if any one has used appcore please let me know how to compile
>> the asm file and create so file.
>>
>>
>> Please let me know other than appcore is there any other lock free
>> datastructure library available for linux.
>
> Check here:
>
> http://atomic-ptr-plus.sourceforge.net
also make sure to check here:
http://www.cl.cam.ac.uk/research/srg/netos/lock-free
and here of course!:
http://research.sun.com/scalable
I am very sorry for any inconvenience. Please keep me informed of your
struggles with AppCore, or any lock-free algo for that matter; also, keep
this NG in mind.
== 7 of 9 ==
Date: Sat, Feb 28 2009 1:02 am
From: "Chris M. Thomasson"
"nithesh" <nithesh@gmail.com> wrote in message
news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
> Hi,
>
> I am a beginner in lock free datastructure.. I have downloaded Appcore
> source files from http://webpages.charter.net/appcore. appcore has
> provided an asm file named ac_i686_masm.asm. This file gives following
> compile time error::
> ac_i686_atomic_inc_fence redefined
> Platform used : Red Hat 3.4.3-9
> In case if any one has used appcore please let me know how to compile
> the asm file and create so file.
>
>
> Please let me know other than appcore is there any other lock free
> datastructure library available for linux.
No makefile in AppCore. I expect you to be able to work with the sources
files and assemble assembles as is.
== 8 of 9 ==
Date: Sat, Feb 28 2009 1:07 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:n37ql.15764$l71.9067@newsfe23.iad...
>
> "nithesh" <nithesh@gmail.com> wrote in message
> news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
>> Hi,
>>
>> I am a beginner in lock free datastructure.. I have downloaded Appcore
>> source files from http://webpages.charter.net/appcore. appcore has
>> provided an asm file named ac_i686_masm.asm. This file gives following
>> compile time error::
>> ac_i686_atomic_inc_fence redefined
>> Platform used : Red Hat 3.4.3-9
>> In case if any one has used appcore please let me know how to compile
>> the asm file and create so file.
>>
>>
>> Please let me know other than appcore is there any other lock free
>> datastructure library available for linux.
>
>
> No makefile in AppCore. I expect you to be able to work with the sources
> files and assemble assembles as is.
BTW, how did you even get GAS to give you a single error? I try to assemble
the MASM file with GAS on several Unix x86-32 archs and I get a boat load of
errors. Here is some of what I get via MingW:
whoot.asm: Assembler messages:
whoot.asm:1: Error: no such instruction: `copyright 2005 Chris Thomasson'
whoot.asm:4: Error: unknown pseudo-op: `.686'
whoot.asm:5: Error: unknown pseudo-op: `.xmm'
whoot.asm:6: Error: unknown pseudo-op: `.model'
whoot.asm:7: Error: unknown pseudo-op: `.code'
whoot.asm:12: Error: no such instruction: `align 16'
whoot.asm:13: Error: invalid character '_' in mnemonic
whoot.asm:16: Error: invalid char '[' beginning operand 2 `[esp+16]'
whoot.asm:17: Error: invalid char '[' beginning operand 2 `[esi]'
whoot.asm:18: Error: invalid char '[' beginning operand 2 `[esi+4]'
whoot.asm:19: Error: invalid char '[' beginning operand 2 `[esp+20]'
whoot.asm:20: Error: invalid char '[' beginning operand 2 `[esi]'
whoot.asm:21: Error: invalid char '[' beginning operand 2 `[esi+4]'
whoot.asm:22: Error: invalid char '[' beginning operand 2 `[esp+12]'
whoot.asm:23: Error: junk `ptr [esi]' after expression
whoot.asm:25: Error: too many memory references for `xor'
whoot.asm:31: Error: invalid char '[' beginning operand 2 `[esp+16]'
whoot.asm:32: Error: invalid char '[' beginning operand 1 `[esi+0]'
whoot.asm:33: Error: invalid char '[' beginning operand 1 `[esi+4]'
whoot.asm:34: Error: too many memory references for `mov'
whoot.asm:38: Error: invalid character '_' in mnemonic
whoot.asm:43: Error: no such instruction: `align 16'
whoot.asm:44: Error: invalid character '_' in mnemonic
whoot.asm:45: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:46: Error: invalid char '[' beginning operand 2 `[edx]'
whoot.asm:47: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:50: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:51: Error: invalid char '[' beginning operand 1 `[edx]'
whoot.asm:54: Error: invalid character '_' in mnemonic
whoot.asm:59: Error: no such instruction: `align 16'
whoot.asm:60: Error: invalid character '_' in mnemonic
whoot.asm:65: Error: invalid char '[' beginning operand 2 `[esp+12]'
whoot.asm:66: Error: invalid char '[' beginning operand 2 `[esi+4]'
whoot.asm:67: Error: invalid char '[' beginning operand 2 `[esi]'
whoot.asm:70: Error: invalid char '[' beginning operand 2 `[esp+16]'
whoot.asm:71: Error: invalid char '[' beginning operand 1 `[ebx]'
whoot.asm:73: Error: invalid char '[' beginning operand 2 `[esi]'
whoot.asm:75: Error: too many memory references for `test'
whoot.asm:77: Error: invalid char '[' beginning operand 2 `[eax]'
whoot.asm:78: Error: invalid char '[' beginning operand 2 `[edx+1]'
whoot.asm:79: Error: junk `ptr [esi]' after expression
whoot.asm:83: Error: invalid char '[' beginning operand 2 `[esp+16]'
whoot.asm:84: Error: too many memory references for `xor'
whoot.asm:85: Error: invalid char '[' beginning operand 1 `[esi]'
whoot.asm:89: Error: invalid character '_' in mnemonic
whoot.asm:94: Error: no such instruction: `align 16'
whoot.asm:95: Error: invalid character '_' in mnemonic
whoot.asm:98: Error: invalid char '[' beginning operand 2 `[esp+12]'
whoot.asm:99: Error: invalid char '[' beginning operand 2 `[esi+4]'
whoot.asm:100: Error: invalid char '[' beginning operand 2 `[esi]'
whoot.asm:103: Error: too many memory references for `test'
whoot.asm:105: Error: invalid char '[' beginning operand 2 `[eax]'
whoot.asm:106: Error: invalid char '[' beginning operand 2 `[edx+1]'
whoot.asm:107: Error: junk `ptr [esi]' after expression
whoot.asm:114: Error: invalid character '_' in mnemonic
whoot.asm:119: Error: no such instruction: `align 16'
whoot.asm:120: Error: invalid character '_' in mnemonic
whoot.asm:121: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:122: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:123: Error: invalid char '[' beginning operand 2 `[eax+4]'
whoot.asm:124: Error: junk `be needed on future x86' after expression
whoot.asm:124: Error: suffix or operands invalid for `sfence'
whoot.asm:125: Error: invalid char '[' beginning operand 1 `[edx]'
whoot.asm:126: Error: invalid char '[' beginning operand 1 `[eax+4]'
whoot.asm:128: Error: invalid character '_' in mnemonic
whoot.asm:133: Error: no such instruction: `align 16'
whoot.asm:134: Error: invalid character '_' in mnemonic
whoot.asm:136: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:137: Error: invalid char '[' beginning operand 2 `[ecx]'
whoot.asm:138: Error: invalid char '[' beginning operand 2 `[ecx+4]'
whoot.asm:140: Error: invalid char '[' beginning operand 2 `[eax]'
whoot.asm:141: Error: junk `be needed on future x86' after expression
whoot.asm:141: Error: suffix or operands invalid for `lfence'
whoot.asm:142: Error: invalid char '[' beginning operand 2 `[edx+12]'
whoot.asm:143: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:144: Error: invalid char '[' beginning operand 1 `[eax+12]'
whoot.asm:149: Error: too many memory references for `xor'
whoot.asm:152: Error: invalid character '_' in mnemonic
whoot.asm:157: Error: no such instruction: `align 16'
whoot.asm:158: Error: invalid character '_' in mnemonic
whoot.asm:159: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:160: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:163: Error: invalid char '[' beginning operand 2 `[ecx]'
whoot.asm:164: Error: invalid char '[' beginning operand 1 `[edx]'
whoot.asm:166: Error: invalid char '[' beginning operand 2 `[ecx]'
whoot.asm:169: Error: invalid character '_' in mnemonic
whoot.asm:174: Error: no such instruction: `align 16'
whoot.asm:175: Error: invalid character '_' in mnemonic
whoot.asm:176: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:177: Error: too many memory references for `xor'
whoot.asm:178: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:180: Error: invalid character '_' in mnemonic
whoot.asm:185: Error: no such instruction: `align 16'
whoot.asm:186: Error: invalid character '_' in mnemonic
whoot.asm:189: Error: invalid character '_' in mnemonic
whoot.asm:194: Error: no such instruction: `align 16'
whoot.asm:195: Error: invalid character '_' in mnemonic
whoot.asm:197: Error: invalid character '_' in mnemonic
whoot.asm:202: Error: no such instruction: `align 16'
whoot.asm:203: Error: invalid character '_' in mnemonic
whoot.asm:204: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:205: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:207: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:209: Error: invalid character '_' in mnemonic
whoot.asm:214: Error: no such instruction: `align 16'
whoot.asm:215: Error: invalid character '_' in mnemonic
whoot.asm:216: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:217: Error: invalid char '[' beginning operand 2 `[ecx]'
whoot.asm:220: Error: invalid character '_' in mnemonic
whoot.asm:225: Error: no such instruction: `align 16'
whoot.asm:226: Error: invalid character '_' in mnemonic
whoot.asm:227: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:228: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:229: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:231: Error: invalid character '_' in mnemonic
whoot.asm:236: Error: no such instruction: `align 16'
whoot.asm:237: Error: invalid character '_' in mnemonic
whoot.asm:238: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:239: Error: invalid char '[' beginning operand 2 `[ecx]'
whoot.asm:241: Error: invalid character '_' in mnemonic
whoot.asm:246: Error: no such instruction: `align 16'
whoot.asm:247: Error: invalid character '_' in mnemonic
whoot.asm:248: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:249: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:250: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:252: Error: invalid character '_' in mnemonic
whoot.asm:257: Error: no such instruction: `align 16'
whoot.asm:258: Error: invalid character '_' in mnemonic
whoot.asm:259: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:260: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:261: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:263: Error: invalid character '_' in mnemonic
whoot.asm:268: Error: no such instruction: `align 16'
whoot.asm:269: Error: invalid character '_' in mnemonic
whoot.asm:270: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:271: Error: too many memory references for `mov'
whoot.asm:272: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:273: Error: no instruction mnemonic suffix given and no register
operands
; can't size instruction
whoot.asm:275: Error: invalid character '_' in mnemonic
whoot.asm:280: Error: no such instruction: `align 16'
whoot.asm:281: Error: invalid character '_' in mnemonic
whoot.asm:282: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:283: Error: too many memory references for `mov'
whoot.asm:284: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:285: Error: no instruction mnemonic suffix given and no register
operands
; can't size instruction
whoot.asm:287: Error: invalid character '_' in mnemonic
whoot.asm:292: Error: no such instruction: `align 16'
whoot.asm:293: Error: invalid character '_' in mnemonic
whoot.asm:294: Error: invalid char '[' beginning operand 2 `[esp+4]'
whoot.asm:295: Error: invalid char '[' beginning operand 2 `[esp+8]'
whoot.asm:296: Error: invalid char '[' beginning operand 2 `[esp+12]'
whoot.asm:297: Error: invalid char '[' beginning operand 1 `[ecx]'
whoot.asm:299: Error: invalid character '_' in mnemonic
whoot.asm:304: Error: no such instruction: `end'
== 9 of 9 ==
Date: Sat, Feb 28 2009 6:49 pm
From: "Chris M. Thomasson"
"nithesh" <nithesh@gmail.com> wrote in message
news:7883680b-5449-4818-a898-cb274ae89785@i20g2000prf.googlegroups.com...
> Hi,
>
> I am a beginner in lock free datastructure.. I have downloaded Appcore
> source files from http://webpages.charter.net/appcore. appcore has
> provided an asm file named ac_i686_masm.asm. This file gives following
> compile time error::
> ac_i686_atomic_inc_fence redefined
> Platform used : Red Hat 3.4.3-9
> In case if any one has used appcore please let me know how to compile
> the asm file and create so file.
as file_name -o object_file_name
==============================================================================
TOPIC: correct use of mfence
http://groups.google.com/group/comp.programming.threads/t/8931f6ece032d2d1?hl=en
==============================================================================
== 1 of 6 ==
Date: Sat, Feb 28 2009 1:32 am
From: Dmitriy Vyukov
On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> "Ram" <shining...@gmail.com> wrote in message
>
> news:915d2208-33de-467e-9682-e5d0641f3241@w24g2000prd.googlegroups.com...
>
>
>
> > Hi,
>
> > I am writting atomic inc/dec/cas operations in assembly.
>
> > increment64(__int64* value, int val)
> > {
> > [...]
> > }
>
> > Requirement is that it should work on single and multi-core
> > hardwares.
>
> > 1. Use of mfence is not clear to me. So I temporarily put mfence
> > before and after cmpxchg8b. I am looking for correct use of mfence
> > opcode in this context. I would like to know how many lines mfence
> > serializes before its use.
> > MFENCE:
> > This serializing operation guarantees that every load and store
> > instruction that precedes in program order the MFENCE instruction is
> > globally visible before any load or store instruction that follows the
> > MFENCE instruction is globally visible
>
> MFENCE makes all preceding loads/stores to write-back/combining memory
> visible before any subsequent store/load instructions are rendered visible.
>
> > 2. If i use mfence then also i need to use lock opcode before
> > cmpxchg8b?
>
> Sure; the MFENCE has no bearing on the atomicity of a RMW instruction.
Well, but if you use LOCK prefix, then you already don't need
MFENCE :)
> > What is the correct use of mfence in above assembly code.
>
> The LOCK prefix acts as a full memory barrier. You would only need MFENCE in
> your `increment64()' function if you also wish to synchronize
> write-combining (e.g., wrt SSE streaming loads/stores) along with write-back
> memory (e.g., from malloc()/free()). If you need to support synchronization
> of SSE streaming instructions, I would make separate functions, one for
> write-back memory, and one for write-combining.
Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
WC memory?
--
Dmitriy V'jukov
== 2 of 6 ==
Date: Sat, Feb 28 2009 2:28 am
From: "Chris M. Thomasson"
"Dmitriy Vyukov" <dvyukov@gmail.com> wrote in message
news:45fa7b28-fa83-472e-8c1d-8dd9a527f1d8@h5g2000yqh.googlegroups.com...
On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> > [...]
> Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
> WC memory?
Does LOCK prefix ensure sync of WC memory if LOCK'ed is already location in
the cache? There can be certain optimizations wrt this specific scenario. I
am not sure if this effects WC memory.
== 3 of 6 ==
Date: Sat, Feb 28 2009 2:37 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:mk8ql.40320$g63.18200@newsfe24.iad...
> "Dmitriy Vyukov" <dvyukov@gmail.com> wrote in message
> news:45fa7b28-fa83-472e-8c1d-8dd9a527f1d8@h5g2000yqh.googlegroups.com...
> On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
>> > [...]
>> Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
>> WC memory?
>
> Does LOCK prefix ensure sync of WC memory if LOCK'ed is already location
> in the cache? There can be certain optimizations wrt this specific
> scenario. I am not sure if this effects WC memory.
IIRC, if target address is already in cache, then LOCK signal can be
avoided.
== 4 of 6 ==
Date: Sat, Feb 28 2009 2:39 am
From: "Chris M. Thomasson"
"Chris M. Thomasson" <no@spam.invalid> wrote in message
news:mk8ql.40320$g63.18200@newsfe24.iad...
> "Dmitriy Vyukov" <dvyukov@gmail.com> wrote in message
> news:45fa7b28-fa83-472e-8c1d-8dd9a527f1d8@h5g2000yqh.googlegroups.com...
> On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
>> > [...]
>> Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
>> WC memory?
>
> Does LOCK prefix ensure sync of WC memory if LOCK'ed is already location
> in the cache? There can be certain optimizations wrt this specific
> scenario. I am not sure if this effects WC memory.
I am probably missing something here!
;^(
Please enlighten me Dmitriy.
== 5 of 6 ==
Date: Sat, Feb 28 2009 6:47 am
From: Dmitriy Vyukov
On Feb 28, 1:39 pm, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> "Chris M. Thomasson" <n...@spam.invalid> wrote in messagenews:mk8ql.40320$g63.18200@newsfe24.iad...
>
> > "Dmitriy Vyukov" <dvyu...@gmail.com> wrote in message
> >news:45fa7b28-fa83-472e-8c1d-8dd9a527f1d8@h5g2000yqh.googlegroups.com...
> > On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> >> > [...]
> >> Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
> >> WC memory?
>
> > Does LOCK prefix ensure sync of WC memory if LOCK'ed is already location
> > in the cache? There can be certain optimizations wrt this specific
> > scenario. I am not sure if this effects WC memory.
>
> I am probably missing something here!
>
> ;^(
>
> Please enlighten me Dmitriy.
Sorry for that. I was always thinking that LOCK is a kind of superset
of MFENCE. It turns out that this is architecture dependent:
------------------------------
For the P6 family processors, locked operations serialize all
outstanding load and store operations (that is, wait for them to
complete). This rule is also true for the Pentium 4 and Intel Xeon
processors, with one exception. Load operations that reference weakly
ordered memory types (such as the WC memory type) may not be
serialized.
------------------------------
--
Dmitriy V'jukov
== 6 of 6 ==
Date: Sun, Mar 1 2009 12:03 am
From: Dmitriy Vyukov
On Feb 28, 5:47 pm, Dmitriy Vyukov <dvyu...@gmail.com> wrote:
> On Feb 28, 1:39 pm, "Chris M. Thomasson" <n...@spam.invalid> wrote:
>
>
>
> > "Chris M. Thomasson" <n...@spam.invalid> wrote in messagenews:mk8ql.40320$g63.18200@newsfe24.iad...
>
> > > "Dmitriy Vyukov" <dvyu...@gmail.com> wrote in message
> > >news:45fa7b28-fa83-472e-8c1d-8dd9a527f1d8@h5g2000yqh.googlegroups.com...
> > > On Feb 28, 2:49 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> > >> > [...]
> > >> Hmmm... Chris, doesn't LOCK also synchronize non-temporal stores and
> > >> WC memory?
>
> > > Does LOCK prefix ensure sync of WC memory if LOCK'ed is already location
> > > in the cache? There can be certain optimizations wrt this specific
> > > scenario. I am not sure if this effects WC memory.
>
> > I am probably missing something here!
>
> > ;^(
>
> > Please enlighten me Dmitriy.
>
> Sorry for that. I was always thinking that LOCK is a kind of superset
> of MFENCE. It turns out that this is architecture dependent:
>
> ------------------------------
> For the P6 family processors, locked operations serialize all
> outstanding load and store operations (that is, wait for them to
> complete). This rule is also true for the Pentium 4 and Intel Xeon
> processors, with one exception. Load operations that reference weakly
> ordered memory types (such as the WC memory type) may not be
> serialized.
> ------------------------------
But for synchronization of non-temporal stores and WC memory SFENCE is
enough, which is some cheaper.
--
Dmitriy V'jukov
==============================================================================
TOPIC: threads and log
http://groups.google.com/group/comp.programming.threads/t/3b3c208c958b241e?hl=en
==============================================================================
== 1 of 8 ==
Date: Sat, Feb 28 2009 1:36 am
From: Darkbyte
Hello everybody!
I have a multi-thread project, in which I'd like to add a function
addlog(char *text).
The function should open a file, write the text, close the file.
Question: if the execution switch from a thread to another when the
file has not been closed yet, what can be written?
Maybe I'll read something like two merged text?
I should use the addlog() in many points of the threads functions, so
a down() or up() in the addlog() could make slow the entire execution,
or am I wrong?
How can I log in the same file without problems?
I also could write more logs, one-per-thread, but find a bug reading
more files will be hard...
Thanx!!!
== 2 of 8 ==
Date: Sat, Feb 28 2009 11:29 am
From: David Schwartz
On Feb 28, 1:36 am, Darkbyte <seprano.anto...@gmail.com> wrote:
> Hello everybody!
> I have a multi-thread project, in which I'd like to add a function
> addlog(char *text).
> The function should open a file, write the text, close the file.
> Question: if the execution switch from a thread to another when the
> file has not been closed yet, what can be written?
> Maybe I'll read something like two merged text?
> I should use the addlog() in many points of the threads functions, so
> a down() or up() in the addlog() could make slow the entire execution,
> or am I wrong?
> How can I log in the same file without problems?
> I also could write more logs, one-per-thread, but find a bug reading
> more files will be hard...
Why close the file in the function if the function is a possible
performance bottleneck?
DS
== 3 of 8 ==
Date: Sat, Feb 28 2009 4:01 pm
From: Marcel Müller
Darkbyte wrote:
> I have a multi-thread project, in which I'd like to add a function
> addlog(char *text).
> The function should open a file, write the text, close the file.
Bad idea.
> Question: if the execution switch from a thread to another when the
> file has not been closed yet, what can be written?
That depends on your open mode. But whatever happens it is very likely
not that what you want, because appending to a file is not atomic in
most cases and operating systems.
> Maybe I'll read something like two merged text?
Maybe.
> I should use the addlog() in many points of the threads functions, so
> a down() or up() in the addlog() could make slow the entire execution,
> or am I wrong?
Whatever up() and down() is.
> How can I log in the same file without problems?
Either use a mutex or use the same stream handle for all threads and
write with a single runtime call. normally calls to the i/o functions of
a single stream are serialized by the runtime anyway.
> I also could write more logs, one-per-thread, but find a bug reading
> more files will be hard...
Yes.
In fact you should always write
- a time stamp,
- the current thread id and
- the stack pointer
in addlog. Otherwise it will be difficult to interpret the log.
If not otherwise needed you may simply log to stderr which you can
redirect to a file when starting your application.
Marcel
== 4 of 8 ==
Date: Sat, Feb 28 2009 4:34 pm
From: "Chris M. Thomasson"
"Darkbyte" <seprano.antonio@gmail.com> wrote in message
news:9498d41c-2bca-4c06-a2f1-dcbc9350bbc5@c11g2000yqj.googlegroups.com...
> Hello everybody!
> I have a multi-thread project, in which I'd like to add a function
> addlog(char *text).
> The function should open a file, write the text, close the file.
> Question: if the execution switch from a thread to another when the
> file has not been closed yet, what can be written?
> Maybe I'll read something like two merged text?
> I should use the addlog() in many points of the threads functions, so
> a down() or up() in the addlog() could make slow the entire execution,
> or am I wrong?
> How can I log in the same file without problems?
> I also could write more logs, one-per-thread, but find a bug reading
> more files will be hard...
I did a logging system that went something like this:
1. a dedicated logging thread that was comprised of a list of registered
application threads.
2. a plurality of application threads that have a private single
producer/consumer queue per-thread.
3. a log entry comprised of a timestamp, thread id, importance, status,
ect...
4. log entries are enqueued by a thread into its private queue.
5. dedicated logging thread periodically samples each of registered
application threads private queues.
6. log entries are dequeued, sorted, and written to a file by the single
dedicated log thread.
This logging scheme scales, and does not even need any mutexs on the single
producer/consumer queues.
It worked very well.
== 5 of 8 ==
Date: Sat, Feb 28 2009 4:41 pm
From: Marcel Müller
Hi,
Chris M. Thomasson wrote:
[...]
> This logging scheme scales, and does not even need any mutexs on the
> single producer/consumer queues.
not even for the allocation of storage for the data that is logged?
I wonder a bit who owns the storage while the log items are in the queue.
Another disadvantage might be that the last log messages are lost in
case of an application crash. OK, a signal handler might recover from this.
Marcel
== 6 of 8 ==
Date: Sat, Feb 28 2009 5:47 pm
From: "Chris M. Thomasson"
"Marcel Müller" <news.5.maazl@spamgourmet.com> wrote in message
news:49a9d9b4$0$31871$9b4e6d93@newsspool3.arcor-online.net...
> Hi,
>
> Chris M. Thomasson wrote:
> [...]
>> This logging scheme scales, and does not even need any mutexs on the
>> single producer/consumer queues.
>
> not even for the allocation of storage for the data that is logged?
It really depends on the implementation of the underlying allocator. In the
particular scheme I created, log messages were finite in length, so a thread
pre-allocated them in bulk at birth; the act of dequeuing a pre-allocated
buffer is very cheap.
> I wonder a bit who owns the storage while the log items are in the queue.
Once a log buffer was queued, it belongs to the dedicated logger thread; it
was a simple transfer of ownership. The logging thread was responsible for
freeing buffers. Also, I simply failed to mention that when a thread ended
its lifetime, its TSD dtor fired up which transferred all remaining log
entries to the main log thread via a multiple producer single consumer
queue.
> Another disadvantage might be that the last log messages are lost in case
> of an application crash.
If an application crashes, well, AFAICT its undefined exactly where things
stop working. So, IMVHO, an application crash can adversely effect other
logging schemes as well.
> OK, a signal handler might recover from this.
Indeed.
== 7 of 8 ==
Date: Sat, Feb 28 2009 11:19 pm
From: Dmitriy Vyukov
On Mar 1, 3:41 am, Marcel Müller <news.5.ma...@spamgourmet.com> wrote:
> Hi,
>
> Chris M. Thomasson wrote:
>
> [...]
>
> > This logging scheme scales, and does not even need any mutexs on the
> > single producer/consumer queues.
>
> not even for the allocation of storage for the data that is logged?
One may use following scheme to manage memory (atomic-free too):
http://groups.google.com/group/comp.programming.threads/browse_frm/thread/378a35b21ae2b42e/
Although it requires per-producer buffering of memory, so it may cause
excessive memory consumption. So one better bound number of per-
producer memory blocks, and use something like spin-wait if all memory
blocks are busy. Otherwise one can run into following very bad
situation:
http://blogtrader.net/page/dcaoyuan/entry/a_case_study_of_scalable
> I wonder a bit who owns the storage while the log items are in the queue.
Consumer (log thread).
> Another disadvantage might be that the last log messages are lost in
> case of an application crash. OK, a signal handler might recover from this.
Another solution is to allocate log buffers in shared memory.
--
Dmitriy V'jukov
== 8 of 8 ==
Date: Sat, Feb 28 2009 11:54 pm
From: Dmitriy Vyukov
On Mar 1, 3:34 am, "Chris M. Thomasson" <n...@spam.invalid> wrote:
> This logging scheme scales, and does not even need any mutexs on the single
> producer/consumer queues.
I am only a bit concerned with the fact that large amount amounts of
memory are constantly transferred between the threads. So this may
cause a large cache-coherence overheads, which may be significantly
larger than mutex acquisition. What do you think about this? Or logger
thread is not touching the memory and just simply offloads it to the
OS for writing to the file?
--
Dmitriy V'jukov
==============================================================================
TOPIC: CFP with extended deadline of Mar. 11, 2009: WORLDCOMP'09 (The 2009
World Congress in Computer Science, Computer Engineering, and Applied
Computing), USA, July 13-16, 2009
http://groups.google.com/group/comp.programming.threads/t/2b509e463f1901f0?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Feb 28 2009 1:51 am
From: "A. M. G. Solo"
I would appreciate if you would share the announcement below
with those who might be interested. The paper submission deadline
is extended to March 11, 2009.
Call For Papers
Extended Paper Submission Deadline: March 11, 2009
WORLDCOMP'09
The 2009 World Congress in Computer Science,
Computer Engineering, & Applied Computing
Date and Location: July 13-16, 2009, Las Vegas, USA
http://www.world-academy-of-science.org
Due to numerous requests, the paper submission deadline has been
extended to March 11, 2009. You are invited to submit a paper; see
below for submission instructions. All accepted papers will be
published in the respective conference proceedings (in printed books).
Academic Sponsors include: United States Military Academy, Network
Science Center; various research laboratories and centers affiliated
with Harvard U. / MIT; Argonne National Lab.; U. of Illinois at
Urbana-Champaign; Minnesota Supercomputing Institute; U. of Texas at
Austin; George Mason U.; Vienna U. of Technology; U. of Siegen;
National Institute for Health Research; U. of Iowa; Russian Academy
of Sciences; U. of North Dakota; Texas A&M U./Com.; The European
Commission, and many others. For the complete list of sponsors,
refer to
http://www.world-academy-of-science.org/worldcomp09/ws/sponsors
The 2009 World Congress in Computer Science, Computer Engineering,
and Applied Computing (WORLDCOMP'09) is composed of the following
conferences (all will be held simultaneously, same location and
dates: July 13-16, 2009, USA). A link to each conference's URL can
be found at
http://www.world-academy-of-science.org
BIOCOMP'09: International Conf. on Bioinformatics &
Computational Biology
CDES'09: International Conf. on Computer Design
CGVR'09: International Conf. on Computer Graphics & Virtual
Reality
CSC'09: International Conf. on Scientific Computing
DMIN'09: International Conf. on Data Mining
EEE'09: International Conf. on e-Learning, e-Business,
Enterprise Information Systems, & e-Government
ERSA'09: International Conf. on Engineering of Reconfigurable
Systems and Algorithms
ESA'09: International Conf. on Embedded Systems & Applications
FCS'09: International Conf. on Foundations of Computer Science
FECS'09: International Conf. on Frontiers in Education: Computer
Science & Computer Engineering
GCA'09: International Conf. on Grid Computing & Applications
GEM'09: International Conf. on Genetic & Evolutionary Methods
ICAI'09: International Conf. on Artificial Intelligence
ICOMP'09: International Conf. on Internet Computing
ICWN'09: International Conf. on Wireless Networks
IKE'09: International Conf. on Information & Knowledge
Engineering
IPCV'09: International Conf. on Image Processing, Computer
Vision, & Pattern Recognition
MSV'09: International Conf. on Modeling, Simulation &
Visualization Methods
PDPTA'09: International Conf. on Parallel and Distributed
Processing Techniques & Applications
SAM'09: International Conf. on Security and Management
SERP'09: International Conf. on Software Engineering Research
and Practice
SWWS'09: International Conf. on Semantic Web and Web Services
SUBMISSION OF PAPERS:
Prospective authors are invited to submit their draft papers by
uploading them to http://worldcomp.cviog.uga.edu/ .
Submissions must be received by March 11, 2009 and they must be in
either MS doc or pdf formats (about 5 to 7 pages - single space,
font size of 10 to 12). All reasonable typesetting formats are
acceptable (later, the authors of accepted papers will be asked to
follow a particular typesetting format to prepare their papers for
publication.)
The length of the Camera-Ready papers (if accepted) will be limited
to 7 (IEEE style) pages. Papers must not have been previously
published or currently submitted for publication elsewhere. The
first page of the draft paper should include: title of the paper,
name, affiliation, postal address, and email address for each
author.
The first page should also identify the name of the Contact Author
and a maximum of 5 topical keywords that would best represent the
content of the paper. Finally, the name of the conference that
the paper is being submitted to must be stated on the first page.
Papers will be evaluated for originality, significance, clarity,
impact, and soundness. Each paper will be refereed by two experts
in the field who are independent of the conference program
committee.
The referees' evaluations will then be reviewed by two members of
the program committee who will recommend a decision to the chair of
the track that the paper has been submitted to. The chair will
make
the final decision. Lastly, the Camera-Ready papers will be
reviewed
by one member of the program committee.
IMPORTANT DATES:
March 11, 2009: Extended deadline for Submission of papers
(about 5 to 7 pages)
April 9, 2009: Notification of acceptance
May 1, 2009: Camera-Ready papers and Registration due
July 13-16, 2009: The 2009 World Congress in Computer Science,
Computer Engineering, and Applied Computing
(WORLDCOMP'09 - 22 joint conferences)
TUTORIALS:
12 to 15 tutorials are currently being planned - all tutorials are
free to conference registrants. Tutorial subjects include:
various aspects of supercomputing (parallel and distributed systems
and processing), visualization, preparation for teaching online
courses, various areas of security, sensor networks, bioinformatics
for computer scientists, web services for mobile and wireless
systems,
ABET accreditation as it relates to computing, inverse problems in
computer vision, data mining, ...
PURPOSE / HISTORY:
This set of joint conferences is the largest annual gathering of
researchers in computer science, computer engineering and applied
computing. Many of the joint conferences in WORLDCOMP are the
premier conferences for presentation of advances in their
respective fields. We anticipate to have 2,400 or more attendees
from over 85 countries participating in the 2009 joint conferences.
WORLDCOMP'09 will be composed of research presentations, keynote
lectures, invited presentations, tutorials, panel discussions,
and poster presentations. In recent past, keynote and/or tutorial
speakers included: Prof. David A. Patterson (U. of California,
Berkeley); Prof. Michael J. Flynn (Stanford U.); Prof. John H.
Holland (U. of Michigan, Ann Arbor); Prof. H. J. Siegel (Colorado
State U.); Prof. Barry Vercoe (MIT); Prof. Ruzena Bajcsy (U. of
California, Berkeley); Prof. Jun Liu (Harvard U.); Dr. Jim Gettys
(OLPC + developer of X Window); and many other distinguished
speakers. For this year's conference, the keynote speakers
include:
Prof. Ian Foster (Father of Grid Computing), Dr. Eric Drexler
(Father of Nanotechnology), Prof. Brian Athey (Head, NIH National
Center for Computational Medicine & Biology), Dr. Jose Munoz
(Deputy
Director, National Science Foundation Office of
Cyberinfrastructure),
and many other distinguished speakers.
The motivation is to assemble a spectrum of affiliated research
conferences into a coordinated research meeting held in a common
place at a common time. The main goal is to provide a forum for
exchange of ideas in a number of research areas that interact. The
model used to form these annual conferences facilitates
communication
among researchers from all over the world in different fields of
computer science, computer engineering and applied computing. Both
inward research (core areas of computer science and engineering)
and
outward research (multi-disciplinary, inter-disciplinary, and
applications) will be covered during the conferences.
LOCATION OF CONFERENCES:
The conferences will be held in the Monte Carlo hotel, Las Vegas,
Nevada, USA (with any overflows at other near-by hotels). This is
a mega hotel with excellent conference facilities and over 3,000
rooms. It is minutes from the airport with 24-hour shuttle
service to and from the airport. This hotel has many recreational
attractions, including: waterfalls, spa, pools, sunning decks, Easy
River, wave pool, lighted tennis courts, health spa, nightly shows,
a number of restaurants, ... The negotiated room rate for
conference attendees is very reasonable. The hotel is within
walking distance from most other attractions (recreational
destinations, Golf courses, ...)
==============================================================================
TOPIC: Synchronising background streaming threads
http://groups.google.com/group/comp.programming.threads/t/8188d6d8e25d219d?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Feb 28 2009 4:08 am
From: JoshG
> I think so. Well, I need to think on this before gibing any advise. Sorry.
> Did you recently take control of this mess or what? Can you use condition
> variables?
Thanks for looking into this Chris,
I haven't just taken control of this, though the code is a library
that is used by another library, hence some bits I can change and
others I can't. I can change the way objects are stored in the list,
and the list structure itself, and what the threads do, but I can't
change the objects that are returned in the queries. Unfortunately the
requirement for this library to be threaded in this way has been
imposed recently (got to love changing specifications!).
As for condition variables, I do not have direct access to these
primitives, I have direct access to CritSections, and Semaphores. I
could probably implement my own condition variables in terms of those
primitives though.
If you have any suggestions on at all for how it might be setup better
I'd be willing to hear them. I'm not ashamed to say I've not touched
threading very much for about 3 years now, so the best practices in
these situations are still beyond me at this stage.
Josh
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.programming.threads"
group.
To post to this group, visit http://groups.google.com/group/comp.programming.threads?hl=en
To unsubscribe from this group, send email to comp.programming.threads+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.programming.threads/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
No comments:
Post a Comment