Wątki po raz kolejny

0

Potrzebuje pomocy, jak z jakiej biblioteki ort! żebym mógł napisać program ort! z kilku wątków i żeby ten kod był przenośny między systemami Windows <-> Unix

0

Żeby koRZystać z wątków biblioteka nie jest potrzebna panie "kokoRZystaćystać".

0

Moglbys podac przyklad kodu tworzacego watek (thread) w c++ bez uzywania bibliotek? (z czystej ciekawosci).

Pod Unixy masz pthread, stosowny przykladzik:
http://lists.debian.org/debian-user-polish/2006/01/msg00066.html

Pod Windows'a to nie wiem, ale raczej nie w ten sam sposob. Żeby uniezaleznic to od platformy bedziesz musial uzyc kompilacji warunkowej - jest o tym art w tym serwisie :)

0

pThreads
boost::thread
DataReel
zapewne większość wieloplatformowych toolkitów do tworzenia GUI (np. wxWidgets)
i mnóstwo innych bibliotek.

0

Stary o ile wiem nie trzeba biblioteki dla wątków.
Korzystasz z funkcji WinApi :

The CreateThread function creates a new thread for a process. Debuggers typically need to examine or change the contents of a thread's registers. To accomplish this, a debugger must obtain a handle of the thread by using the DuplicateHandle function and specifying the appropriate access to the thread (THREAD_GET_CONTEXT, THREAD_SET_CONTEXT, or both).

A process with appropriate access to a thread can examine the thread's registers by using the GetThreadContext function and set the contents of the thread's registers by using the SetThreadContext function.
A process can also obtain THREAD_SUSPEND_RESUME access to a thread. This type of access enables a debugger to control a thread's execution with the SuspendThread and ResumeThread functions. For more information about threads, see Processes and Threads.

0

Aha nie przeczytalem do konca , pomylka.

0

Stary o ile wiem nie trzeba biblioteki dla wątków.
Korzystasz z funkcji WinApi

Sam sobie zaprzeczasz.

1 użytkowników online, w tym zalogowanych: 0, gości: 1