You are not logged in.
Pages: 1
Does anyone know where I can find a good multuthread tutorial ?
Pleassssssssseeeeeeeeeee!!!!!!!!!!
Forever newbie !!!
Offline
The impossible missions are the only ones which succeed.
Offline
The impossible missions are the only ones which succeed.
Offline
Dp is always helping around !!!!
Thank you !!!!
Forever newbie !!!
Offline
wazaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
My mama said once: ...........***K OFF!!!! She was right!
<a href="http://www.nobelcom.com">phone cards</a>
Offline
if you're serious about this, you'll probably want to look into locking data structures and thread syncronization - with threaded programs, you tend to run into data hazards alot (more than one thread attempting to use a shared resource at the same time):
assume a shared variable: int a = 0
thread 1:
a = 5;
a += 2;
thread 2:
a++;
execution can happen as follows:
thread 1: a = 5;
thread 2: a++;
thread 1: a += 2;
both threads now have unexpected results....
Offline
Thank you everyone, I'm very serious about this!!!
Forever newbie !!!
Offline
Many people will tell you the faults of Java, but I don't think even Phrakture can fault its multithreading design. If you have a choice of languages for your project, that will save you a lot of headache.
Dusty
Offline
Many people will tell you the faults of Java, but I don't think even Phrakture can fault its multithreading design. If you have a choice of languages for your project, that will save you a lot of headache.
Dusty
hey, yeah yeah I'll agree the threading design is done very well... it was also the first language I saw to have a simple statement for preventing data hazards.... what was it lock(...) or sync(...) or something like that.
Offline
I have to learn this with c++
Forever newbie !!!
Offline
hey, yeah yeah I'll agree the threading design is done very well... it was also the first language I saw to have a simple statement for preventing data hazards.... what was it lock(...) or sync(...) or something like that.
snychronize I believe..
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
can anybody give me a hint on these mutex characters ???
Please :cry:
Forever newbie !!!
Offline
can anybody give me a hint on these mutex characters ???
Please :cry:
http://en.wikipedia.org/wiki/Mutex
... and if you changed your mind and want a tutorial for java threads, here the one that suited me best for me to learn it some time ago:
The impossible missions are the only ones which succeed.
Offline
I need it at work this way!!!
thank you
Forever newbie !!!
Offline
Many people will tell you the faults of Java, but I don't think even Phrakture can fault its multithreading design. If you have a choice of languages for your project, that will save you a lot of headache.
Dusty
You mean apart from the fact that they implement synchronize differently in different JVM architectures?
I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal
Offline
You mean apart from the fact that they implement synchronize differently in different JVM architectures?
but is that the fault of Java, the language? I would say its the fault of Java, the virtual machine (more specifically its designers).
Dusty
Offline
can anybody give me a hint on these mutex characters ???
Please :cry:
Mutex is short for mutual exclusion - that doesn't do much for non native english speakers, so I'll define further. It is a way to take a group of things (mutual) and leave a portion out (exclude). Basically, a mutex allows you to have a group of threads changing a shared data store (variable, object, memory loc, whatever) at the same time safely.
Before you write to a shared data store, a mutex lock is requested. If it is already locked, the requesting thread waits until it is free. When the thread is able to lock the mutex, it writes to the data store and unlocks the mutex.
for example:
thread a:
lock(mutex);
variable = 5;
unlock(mutex);
thread b:
lock(mutex);
variable += 2;
unlock(mutex);
this way only one change to variable a can be made at a time, thanks to the mutex. Most common mutex usage is like above... lock-write-unlock. You want the mutex to be locked for the shortest time possible, to make performance better.
If you're doing this in C/C++ take a look at pthreads... posix threads.
Offline
Pages: 1