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 on Linux?
Re: MT on Linux? [message #15421 is a reply to message #15407] Wed, 23 April 2008 10:13 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
nixnixnix wrote on Mon, 21 April 2008 17:15

Hey James, no you're not the only one. My app runs for a while with one thread for the interface and one thread doing the work of optimising my windfarm then after maybe 20 iterations it will completely lock up for no discernible reason. I am using Ubuntu 7.10.

I also got the MessageBox error in Win32 when calling PromptOK from a thread that I've made. However, I figured this was reasonable behaviour and so now I call all my message boxes from the main thread which I think is better (Just IMO)

Nick


There was a very fatal (and extremely stupid too) error in Linux/MT recently fixed.

Quick patch:

inline int  AtomicXAdd(volatile Atomic& t, int incr)  { using namespace __gnu_cxx; return __exchange_and_add(&t, incr); }

inline int  AtomicInc(volatile Atomic& t)             { return AtomicXAdd(t, +1) + 1; }
inline int  AtomicDec(volatile Atomic& t)             { return AtomicXAdd(t, -1) - 1; }


Please try, I believe this will help. I have encountered this problem while testing new "CoWork" reference example.

Without this fix, example crashes within 30s. With it, it was running 24 hours until I finally closed it.

Sorry for this problem, it was stupid mistake. MT is sometimes tricky Smile

(And of course, it is not unlikely there are more problems like this one... but definitely, this will fix a lot of issues).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CoWork buggy!?
Next Topic: How to send broadcast
Goto Forum:
  


Current Time: Wed May 15 19:50:23 CEST 2024

Total time taken to generate the page: 0.02490 seconds