On Windows, include boinc_win.h
No references to STDWX_H, STDAFX_H etc.
Note: .cpp files should not have a bunch of gnarly #if logic in their includes.
If such logic is needed, put it in a central place.
They work around the apparent bug in Xcode 11 handling of OpenGL / GLUT on Retina displays, and should continue to work correctly even if future Xcode versions fix the bug.
* Screensavers can't launch setuid / sergid executables like gfx_switcher
* Screensavers can't launch executables downloaded from Internet unless vetted by user vis GateKeeper
* Apple's ScreenSaverEngine doesn't always call stopAnimation before exiting
* Apple's ScreenSaverEngine always passes true for isPreview argument
* OpenGL apps built under Xcode 11 & Catalina use window doubled window dimensions on Retina displays (2 pixels per point)
* The CGWindowList method we have used to display project graphics apps which have not been updated no longer works
* Screensaver output files are put in an obscure sandboxed directory
Remove header from boinc_api.h of the function boinc_try_critical_section() that was removed in
6984ec8cf4
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
When the BOINC API headers are included from C source code that gets compiled with "-Wstrict-prototypes", they generate a lot of "function declaration isn’t a prototype" warnings. The attached patch fixes it by turning "foo()" to "foo(void)".
Gabor
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
To quote from comments in lib/proc_control.cpp:
// The only way to do this on Windows is to enumerate
// all the threads in the entire system,
// and identify those belonging to one of the processes (ugh!!)
//
// In the suspend case, this creates a potential synch problem:
// - CPU throttling sends suspend message
// - we enumerate threads
// - one of those threads creates a new thread T
// - we suspend the enumerated threads
//
// In this case, T will run, which is undesirable but not an error.
// But suppose that
// - the app uses a mutex,
// - at the start of the above sequence some thread holds the mutex
// - T immediately tries to acquire the mutex (and is suspended).
// Then when the client sends a resume message,
// T resumes and there are two threads in the mutex section. Error!
//
// There are a couple of solutions to this.
// 1) enumerate all the threads twice.
// 2) have suspend() make a record of the threads it suspends,
// and have resume() resume only these threads.
//
// 1) doubles the overhead, so I'm going with 2) for now.
From PVS Studio:
V814
Decreased performance. The 'strlen' function was called multiple times inside the body of a loop.
https://www.viva64.com/en/w/V814/print
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Remove "-L$(libdir) -rapth $(libdr)" from LDFLAGS of boinc libraries in
Makefile.am of api, lib, sched and zlib directories to be able to
cross-compile boinc.
Indeed, libdir is not equal to the path where BOINC will be installed
but to exec_prefix/lib. The full installation path is
$(DESTDIR)/$(libdir).
To cross-compile boinc, exec_prefix will be set to the target path (for
example: /usr) and DESTDIR will be set (during make install) to the
staging or target directory on the host (for example /home/xxx/target).
The issue of adding -L$(libdir) is that it is not allowed by the
compiler, the error "unsafe header/library path used in
cross-compilation: '-L/usr/lib'" will be raised.
As a result, remove "-L$(libdir) -rapth $(libdr)" from LDFLAGS, the
default library search paths are sufficient for "standard" compilation
or can be updated manually by passing the additional search path to
LDFLAGS during the configure call for cross-compilation.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Except for very specific cases, strncpy() should never be used.
It can result in a non-terminated string.
Also replace strncat() with strlcat(); the latter is simpler
because you don't have to calculate remaining buffer space.
* Custom IE Javascript interface is gone, it was replaced with a cross-browser Web RPC.
In the HTML doc you can add:
<script type='text/javascript' src='/api/static/boinc.js'></script>
In the JavaScript code you can:
var boinc = new BOINC();
From there you can get the username like:
var userName = boinc.getUserName();
* Default resources are embedded within the executable in much the same way XPM images are embedded in the manager.
/api/static/index.html
/api/static/boinc.png
/api/static/boinc.js
There were two parts to this:
- In the timer thread, we need to check for client death even if
we're in a critical section.
If both conditions hold, set the no_heartbeat status flag.
- In boinc_end_critical_section(), check no_heartbeat and exit if set.
Also: the various checks in boinc_end_critical_section()
(quit, abort, no heartbeat) should be conditioned on
options.direct_process_action.
Otherwise wrappers that use critical sections won't do the right thing.
* the host has GPUs from two different vendors with different OpenCL platforms (e.g., NVIDIA and AMD), and
* the second platform queried has more GPUs than the first one, and
* the requested GPU is a higher numbed one in the second platform.
Sending or receiving trickle messages required setting flags in BOINC_OPTIONS.
There were two problems with this:
1) it wasn't documented
2) it's not necessary; the act of calling boinc_send_trickle_up()
tells the runtime system to do the trickle-up-related stuff.
Furthermore, because intermediate file upload shares message channels
with trickles, these functions also required the option flags
(also undocumented).
With this change, you don't need to set options to use
trickle messages are intermediate file upload.
Vboxwrapper detects known buggy versions of Vbox and calls
boinc_temporary_exit().
The "Incompatible version" message appears in the task status
in the BOINC Manager, where some users may never see it.
It needs to appear as a notice, telling the user to upgrade VBox.
To do this, I added an optional argument to boinc_temporary_exit()
saying that the message should be delivered as a notice.
This is conveyed to the client by adding
a line containing "notice" to the temp exit file.
I changed the client and vboxwrapper to use this.
My last commit did this using a new API call.
But this would require rebuilding apps any time you want to change it;
too much work.
So instead make it an attribute of apps,
which you can set via the admin web interface.
Corresponding changes to client.
Currently the duration estimate for a task is a combination of
- a static estimate, based on wu.rsc_fpops_est and the estimated FLOPS
- a dynamic estimate, based on fraction done (FD) and elapsed time
The weighting of the dynamic estimate is FD^2;
the assumption is that fraction done is imprecise and improves
toward the end of a task.
This isn't ideal for apps that can supply accurate FD.
Solution: add a new API function
boinc_fraction_done_exact().
This notifies the client that the FD is accurate,
and that it should use only the dynamic estimate.
(New clients will do this; old clients will use the FD as the currently do).