Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » MT with speed optimization fails
MT with speed optimization fails [message #24827] Sun, 31 January 2010 22:26 Go to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi!

I encountered a MT related bug while building theide. In speed mode, with flags GUI, NOGTK and MT flags, linking fails with
undefined reference to 'Upp::ReadMemoryBarrier()'
.
With optimal mode, there is no problem. Also adding SSE2 removes the problem.

The function ReadMemoryBarrier() is defined in Core/MT.cpp, on line 266 as inlined. As far as I can tell that is the problem. If I remove the inline keyword, everything compiles correctly. I'm almost sure, that this issue is a result of the speed optimizations. For some reasons WriteMemoryBarrier is not defined as inline and works fine. If inline is added, 'undefined reference' appears when linking in speed mode.

I believe either ReadMemoryBarrier() should not be inline or both Read- and Write- should be inline and moved to MT.h, in similar manner as they are defined for SSE2 enabled case. I tried this and I attach the modified files. Please note that I don't have any idea about how the code works and I'm not sure if it won't cause any performance troubles! It just works and appears to me to represent equivalent code.

Additional info: I have i386 processor (Intel Atom) and use gcc4.4.3 on Arch Linux.
$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,ada 
--enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit 
--disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch 
--with-tune=generic
Thread model: posix
gcc version 4.4.3 (GCC)


Best regards,
Honza
  • Attachment: MT.zip
    (Size: 6.31KB, Downloaded 235 times)
Re: MT with speed optimization fails [message #24844 is a reply to message #24827] Mon, 01 February 2010 13:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
dolik.rce wrote on Sun, 31 January 2010 16:26

Hi!

I encountered a MT related bug while building theide. In speed mode, with flags GUI, NOGTK and MT flags, linking fails with
undefined reference to 'Upp::ReadMemoryBarrier()'
.
With optimal mode, there is no problem. Also adding SSE2 removes the problem.

The function ReadMemoryBarrier() is defined in Core/MT.cpp, on line 266 as inlined. As far as I can tell that is the problem. If I remove the inline keyword, everything compiles correctly.



OK, 'inline' removed. Thanks.

The question is whether SSE2 should not be default... (and NOSSE2 exist instead).

Quote:


Additional info: I have i386 processor (Intel Atom)



How does it run U++?
Re: MT with speed optimization fails [message #24846 is a reply to message #24844] Mon, 01 February 2010 14:39 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Mirek!

Thanks for fix. Having NOSSE2 seems ok, there's not much CPUs running without it anymore... And a lot of poeple doesn't know that SSE2 flag exist, so they don't use it.
luzr wrote on Mon, 01 February 2010 13:53

Quote:

Additional info: I have i386 processor (Intel Atom)
How does it run U++?

I recently bought MSI U100 netbook, thinking it will be just a mobile remote terminal to access my old computer. Well, I was really surprised by the performance of the N280 processor! Smile It is probably even faster than my old single core Athlon which was running on 1,8GHz. The hyperthreading on Atom does a really good job together with build parallelization in theide. Probably also the fact that it has twice as much RAM as the old one plays its part in the speedup Smile I can do some benchmarks, if you're interested.

Honza
Previous Topic: Socket::IsOpen BUG/FIX (?)
Next Topic: DnD hangs in MT Refresh()ing
Goto Forum:
  


Current Time: Thu Mar 28 10:38:18 CET 2024

Total time taken to generate the page: 0.01674 seconds