I need to display a long text string over a pixmap. I want to wrap the text so it appears as a paragraph. I've tried both DrawText() and CGContextShowText() to draw the string (I embedded linefeeds in the string) ... but they do not seem to do line-wrapping automatically.
Does Mac have a...
I need to display a long text string over a pixmap. I want to wrap the text so it appears as a paragraph. I've tried both DrawText() and CGContextShowText() to draw the string (I embedded linefeeds in the string) ... but they do not seem to do line-wrapping automatically.
Does Mac have a...
Thanks for the suggestion about using a single FILE pointer, shared by all the threads.
However, that will not meet the requirements. Recall, the situation is: I've got a huge disk file with thousands of chunks of data scattered thruout it. When the operator hits a key, I've got to read...
When I said it was expensive to upgrade from ProjectBuilder to XCode, I meant all those intangible costs when you've got 80,000 lines of code and everything running smoothly: then you change gears to a new environment. Things that should be no impact never are :-)
Okay ... you've convinced me: If I want to call flockfile() I must upgrade to XCode. Currently we have Tiger-ProjectBuilder.
But upgrading is expensive. What are the odds that using flockfile() will fix my problems?
My application has multiple threads all reading from a single disk...
Okay ... I found stdio.h using "find" in a command window. (for some reason, the GUI "Find" under Finder could not find it?).
My "stdio.h" file does _not_ contain flockfile(). This is /usr/include/stdio.h.
So why do I have a man page for flockfile()?
PS: I'm using ProjectBuilder...
When I add a call to flockfile() into my program (C++ using ProjectBuilder) I get a compiler error .. function not found. I already have #include <stdio.h> and I successfully call many IO functions.
Sure, the man page for flockfile() is there, but the compiler cannot find it.
BTW, I...
I'm using fread() and fseek() stream IO functions in a multi-threaded application. Unfortunately, the data returned by fread() is not correct. From the bytes it returns, I can tell that the internal buffers of the various FILE* objects (one per thread) are interfering with each other...
Thanks for the suggestion about flockfile() ...
But flockfile() is only implemented in some versions of Unix .. and it is not available on my Mac (using Project Builder, Mac OsX).
I do have the fpurge() workaround running ... but it is slower than I want. I dont want to call fpurge()...
I've got an application with multiple threads. They are all reading from a single disk file. The following code works fine on Windows, but produces bad data restults on the Mac:
threadFunction() {
FILE* f = ...;
for (..) {
pthread_mutex_lock(); // ensure threads dont...
If anyone else ever searches the forum with a similar question, here is how I finally got it to work:
The goal was to have multiple threads (in a single process) all reading from the same disk file interleaved. Each thread had dedicated FILE* stream. Initial attempts using simple logic...
I've got an application written in C++ (Project Builder). It has about 8 threads within a single process. All the threads are reading from the same disk file. It is a huge disk file, each thread is reading a different section of the file.
Each thread opens the file with fopen() and gets...